Giter Club home page Giter Club logo

mohitur669 / olympic-data-analysis-webapp Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 12.47 MB

This is an Exploratory Data Analysis project to analyze the modern Olympic Games, including all the Games from Athens 1896 to Rio 2016.

Home Page: https://olympic-analysis.streamlit.app/

Python 0.20% Jupyter Notebook 99.80%
olympic-analysis olympic-data-analysis olympic-games olympics olympics-dataset olympics-visualization data data-analysis-python data-analytics eda

olympic-data-analysis-webapp's Introduction

Exploratory Data Analysis: 120 Years of Olympics History - Python Web App

Introduction

This is an Exploratory Data Analysis project to analyze the modern Olympic Games, including all the Games from Athens 1896 to Rio 2016. This analysis provides an opportunity to ask questions about how the Olympics have evolved over time, including questions about the participation and performance of women, different nations, and different sports and events.

Data Source

The dataset is collected from here. The dataset contains two files: athlete_events.csv and noc_regions.csv.
The file athlete_events.csv contains 271116 rows and 15 columns. Each row corresponds to an individual athlete competing in an individual Olympic event (athlete events). The columns are:

  1. ID - Unique number for each athlete
  2. Name - Athlete's name
  3. Sex - M or F
  4. Age - Integer
  5. Height - In centimetres
  6. Weight - In kilograms
  7. Team - Team name
  8. NOC - National Olympic Committee 3-letter code
  9. Games - Year and season
  10. Year - Integer
  11. Season - Summer or Winter
  12. City - Host city
  13. Sport - Sport
  14. Event - Event
  15. Medal - Gold, Silver, Bronze, or NA

The file noc_regions.csv contains 230 rows and 3 columns. Each row corresponds to an individual region. The columns are:

  1. NOC (National Olympic Committee 3 letter code)
  2. region
  3. notes

Python Web App

This project is deployed on Streamlit Community Cloud. You can access the web app here.
Note: All the graphs and charts are interactive. You can hover over the graphs and charts to get more information. You can also download the graphs and charts in png format.

Features of the Web App

The web app provides a brief overview of the dataset. It provides users to choose between 4 options to explore the dataset. The options are:

  1. Medal Tally
  2. Overall Analysis
  3. Country-wise Analysis
  4. Athlete-wise Analysis

1. Medal Tally

This section provides the medal tally of all the countries that have participated in the Olympics. The medal tally is displayed in a table format. The table can also be filtered by selecting the Country Name and Year from the dropdown list.

2. Overall Analysis

This section provides the overall analysis of the Olympics. It provides information like:

  1. Top Statistics of the Olympics (Edition, Hosts, Sports, Events, Nations, Athletes)
  2. No. of countries participating in the Olympics over the years (Line Graph)
  3. No. of events organized over the years (Line Graph)
  4. No. of athletes participating over the years (Line Graph)
  5. Correlation between the no of Events for each and every Sport w.r.t Year (Heatmap)
  6. Table of top 15 athletes who have won the most number of medals in the Olympics. This table can also be filtered by selecting the Sports Name from the dropdown list.

3. Country-wise Analysis

This section provides a country-wise analysis of the Olympics. It contains a dropdown list where user can select Country Name, based on that the section will display the following information:

  1. Medal Tally over the years for that country (Line Graph)
  2. In which sport does the country excel the most (Heatmap)
  3. Top 10 athletes of that country (Table)

4. Athlete-wise Analysis

This section provides an athlete-wise analysis of the Olympics.

  1. Distribution of Age of the athletes for Winning Medals (Curves)
  2. Distribution of Age w.r.t Sports only who have won Gold Medals (Curves)
  3. Gender Ratio with Height vs Weight of the Athletes. Here users can select a Sport as per their choice from the dropdown list. (Scatter Plot)
  4. Men Vs Women Participation Over the Years (Line Graph)

How to run the project locally

  1. Clone the repository using git clone https://github.com/Mohitur669/Olympic-Data-Analysis-WebApp.git in the terminal
  2. Install the required libraries (mentioned in requirements.txt)
  3. Run the command streamlit run app.py to run the app locally
  4. The web app will open in the browser

About me

I am Mohd Mohitur Rahaman, and currently, I am pursuing MCA from KIIT University, Bhubaneswar. Talking about my previous educational background, I did my BSC in Mathematics at Malda College.

Feedback

If you have any feedback, you can make the changes and create a pull request or, please reach out to me at here or LinkedIn.

olympic-data-analysis-webapp's People

Contributors

mohitur669 avatar

Stargazers

 avatar

Watchers

 avatar

olympic-data-analysis-webapp's Issues

Please fix the bug of heatmap plotting when there is no data

Reproducing the Bug

  1. Run the app.py file through streamlit
  2. Select the "Country-wise Analysis" option
  3. In the "Select a Country" dropdown menu select "Andorra" or maybe "Angola" or maybe "Aruba". In short, the countries which have no data to put into the heatmap give the error mentioned below.

`ValueError: This app has encountered an error. The original error message is redacted to prevent data leaks. Full error details have been recorded in the logs (if you're on Streamlit Cloud, click on 'Manage app' in the lower right of your app).

Traceback:
File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
exec(code, module.dict)
File "/app/olympic-data-analysis-webapp/app.py", line 127, in
ax = sns.heatmap(pt, annot=True)
File "/home/appuser/venv/lib/python3.9/site-packages/seaborn/matrix.py", line 446, in heatmap
plotter = _HeatMapper(data, vmin, vmax, cmap, center, robust, annot, fmt,
File "/home/appuser/venv/lib/python3.9/site-packages/seaborn/matrix.py", line 163, in init
self._determine_cmap_params(plot_data, vmin, vmax,
File "/home/appuser/venv/lib/python3.9/site-packages/seaborn/matrix.py", line 202, in _determine_cmap_params
vmin = np.nanmin(calc_data)
File "<array_function internals>", line 200, in nanmin
File "/home/appuser/venv/lib/python3.9/site-packages/numpy/lib/nanfunctions.py", line 343, in nanmin
res = np.fmin.reduce(a, axis=axis, out=out, **kwargs)`

Please fix the bug as soon as possible.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.