Before clicking “Create Topic”, please make sure your post includes the following information (otherwise, the post will be locked).
-
I am running your app locally
-
link to your app’s public GitHub repository (including a [requirements file] → Olympic-analysis/app.py at main · Shekhar-Raj/Olympic-analysis · GitHub(https://docs.streamlit.io/streamlit-cloud/get-started/deploy-an-app/app-dependencies)).
-
Share the full text of the error message (not a screenshot).
-
Python version → 3.12.1
Streamlit, version 1.30.0
import streamlit as st
import pandas as pd
import preprocessor,helper
def main():
df = pd.read_csv('athlete_events.csv')
region_df = pd.read_csv('noc_regions.csv')
df = preprocessor.preprocess(df, region_df)
user_menu = st.sidebar.radio(
'Select an Option',
('Medal Tally','Overall Analysis','Country-wise Analysis','Athlete wise Analysis')
)
if user_menu == 'Medal tally':
st.header("Medal Tally")
years, country = helper.country_year_list(df)
selected_year = st.sidebar.selectbox("Select Year",years)
selected_country = st.sidebar.selectbox("Select Country", country)
medal_tally = helper.medal_tally(df)
st.dataframe(medal_tally)
if __name__ == "__main__":
main()
```[quote="shekhar_421, post:1, topic:60830, full:true"]
i am running the app locally
github link of code --> https://github.com/Shekhar-Raj/Olympic-analysis/blob/main/app.py
python --> 3.12.1
streamlit version -->1.30.0
![error image|690x388](upload://vjFth7Nc6RHuzZZsU2ZMuspOjdw.jpeg)
import streamlit as st
import pandas as pd
import preprocessor,helper
def main():
df = pd.read_csv('athlete_events.csv')
region_df = pd.read_csv('noc_regions.csv')
df = preprocessor.preprocess(df, region_df)
user_menu = st.sidebar.radio(
'Select an Option',
('Medal Tally','Overall Analysis','Country-wise Analysis','Athlete wise Analysis')
)
if user_menu == 'Medal tally':
st.header("Medal Tally")
years, country = helper.country_year_list(df)
selected_year = st.sidebar.selectbox("Select Year",years)
selected_country = st.sidebar.selectbox("Select Country", country)
medal_tally = helper.medal_tally(df)
st.dataframe(medal_tally)
if __name__ == "__main__":
main()