![]() |
VOOZH | about |
In this article, we are going to see the Olympics analysis using Python. The modern Olympic Games or Olympics are leading international sports events featuring summer and winter sports competitions in which thousands of athletes from around the world participate in a variety of competitions. The Olympic Games are considered the world's foremost sports competition with more than 200 nations participating.
The total number of events in the Olympics is 339 in 33 sports. And for every event there are winners. Therefore various data is generated. So, by using Python we will analyze this data.
When dealing with Olympic data, we have two CSV files. One containing outturn sports-related costs of the Olympic Games of all years. And other is containing the information about athletes of all years when they participated with information.
CSV data file can be download from here: Datasets
We imported both the datasets using the .read_csv() method into a dataframe using pandas and displayed the first 5 rows of each dataset.
Output:
Here we are going to merge two dataframe using pandas.merge() in python.
Output:
Data is now available now using pandas and matplotlib lets see some examples
Creating a new data frame including only gold medalists.
Output :
Here we are going to create a graph of the number of gold medals with respect to age. For this, we will create countplot for graph representation which shows the X-axis as the age of the players and the Y-axis represent the number of medals.
Output :
Print the number of athletes who are gold medalists and whose age is greater than 50 with their info.
Output :
Create a new dataframe called masterDisciplines in which we will insert this new set of people and then create a visualization with it
Output :
Display all women athletes who have played in the summer season and it show the increase in women athletes after a long period via graphical representation.
Output :
Here we are going to print the top 5 countries and show them in the graph with catplot.
output:
Here we are going to see how weight over year for Male Lifters via graphical representation using pointplot.
Output :