A program that I constructed for ranking universities based on two files provided by the user. One would contain the list of universities around the world ranked in order, and another file contains the various countries and its corresponding capital. In this instance, I used two files called capitals.csv and TopUni.csv. I chose to create this program by using one function, however, this program can be altered and constructed by using multiple functions. Since the files that we are using are comma separated values (csv), I chose to open them by importing and using pandas as pd. The output was displayed on an output.txt file to record my output in that file. Below are the following calculations that were made in the program.
- The first part of the program details the total number of universities in the TopUni.csv file.
- The second part of the program displays all the available countries
- The third part of the program illustrates all the available continents
- The next part of the program identifies the international and national rankings that are associated with the selected country
- The following portion of the code calculates the average score, relative score,
- The next part determines the capital of the selected country
- The last part of the code outputs the universities name(s) that contain the capital