This project provides an exploratory data analysis (EDA) and visual insights into the Olympics dataset. Using Python, Jupyter Notebook, and Streamlit, the project analyzes patterns, medal tallies, country-specific performance, and athlete statistics. The primary goal is to allow users to explore historical Olympic data in an interactive web app.
athlete_events.csv: Contains information about athletes, including names, countries, events, and medal records.
noc_regions.csv: Maps National Olympic Committees (NOC) codes to respective regions/countries.
EDA: Conducted in Jupyter Notebook to clean and analyze the dataset.
Streamlit App: Interactive app for visualizing the data.
Helper and Preprocessor Scripts: Scripts used to process and structure data for the Streamlit app.
Olympics120analysis.ipynb: Contains data cleaning, analysis, and visualizations.
app.py: Streamlit app for interactive data exploration.
preprocessor.py: Preprocessing functions for data merging and transformation.
helper.py: Contains functions for querying and aggregating data for app visualization.
Clone this repository and navigate to the project directory. Install required dependencies:
pip install -r requirements.txt
Ensure that athlete_events.csv and noc_regions.csv are in the project directory.
-
Jupyter Notebook:
Open .ipynb to view the exploratory analysis.
-
Streamlit App:
Run the app:
streamlit run app.py
- Data Cleaning:
. Filtered data for only "Summer" Olympics.
. Removed duplicates and merged athlete data with regional codes.
- Medal Tally Calculation:
. Aggregated medal counts by country for each year.
- Visualizations:
. Line charts for participation trends over time.
. Heatmaps for events per sport over the years.
. Distribution plots for athlete ages by medal type.
- Functions:
. fetch_year_country(): Fetches medal tally for a specific year and/or country. . most_successful(): Identifies top medalists in each sport.
. Sidebar Options:-
- Medal Tally: View medal counts by year and country.




- Overall Analysis: Summary statistics including total editions, sports, athletes, and a timeline of events and participants.








- Country-wise Analysis: Examine medal tallies and top athletes for selected countries.




. Key Features
- Interactive Graphs: Includes line plots and heatmaps using Plotly and Seaborn.
- Data Selection: Filters by year, country, and sport.
-
fetch_year_country(): Retrieves medal data based on year and country.
-
medal_tally(): Aggregates medal counts.
-
country_year_list(): Generates lists of unique years and countries for selection.
preprocess(): Merges athlete_events and noc_regions datasets and handles data preprocessing for analysis.
Python: Core language for data manipulation and app development.
Pandas, NumPy: Data handling and preprocessing.
Plotly, Seaborn, Matplotlib: Data visualization.
Streamlit: Web app framework.