louiecerv's picture
save
9af8cf8
import streamlit as st
import pandas as pd
# Set page title
st.title("Student Grades Analysis")
# File uploader for CSV
uploaded_file = st.file_uploader("Upload your student grades CSV file", type=["csv"])
if uploaded_file is not None:
# Read the CSV file
df = pd.read_csv(uploaded_file)
# Display the DataFrame
st.subheader("Uploaded DataFrame")
st.dataframe(df)
# Display descriptive statistics
st.subheader("Descriptive Statistics")
st.write("**Basic Statistics for Numeric Columns**")
st.dataframe(df.describe())
# Additional statistics
st.write("**Column Data Types**")
st.write(df.dtypes)
st.write("**Missing Values**")
st.write(df.isnull().sum())
st.write("**Gender Distribution**")
st.write(df['gender'].value_counts())
st.write("**Correlation between Physics and Math Grades**")
st.write(df[['physics_grade', 'math_grade']].corr())
else:
st.info("Please upload a CSV file to see the data and statistics.")