|
!pip install streamlit |
|
!pip install pandas |
|
!pip install numpy |
|
|
|
import streamlit as st |
|
import pandas as pd |
|
import numpy as np |
|
|
|
|
|
|
|
|
|
df = pd.read_csv("TIMES_WorldUniversityRankings_2024.csv") |
|
|
|
|
|
|
|
st.title('University Data portal') |
|
|
|
|
|
search_type = st.radio("Choose your search type:", ('University', 'Country')) |
|
|
|
if search_type == 'University': |
|
university_name = st.selectbox('Select University', df['name'].unique()) |
|
selected_uni = df[df['name'] == university_name] |
|
if not selected_uni.empty: |
|
st.write(selected_uni) |
|
else: |
|
country_name = st.selectbox('Select Country', df['location'].unique()) |
|
selected_country = df[df['location'] == country_name] |
|
if not selected_country.empty: |
|
st.write(selected_country[['name', 'scores_teaching', 'scores_research', 'scores_citations']]) |
|
|
|
|