Question: Please help me find the solution to this Python coding exercise. It's easy but required to know how Python works. Of course i'll give you

Please help me find the solution to this Python coding exercise. It's easy but required to know how Python works. Of course i'll give you a big like

The 2016 Summer Olympics was held in Rio de Janeiro, Brazil, in the summer of 2016. More than 11,000 athletes from 200 more nations took part in the 2016 Games. You are dealing with the data of athletes and countries in 2016 Summer Olympics. There are 3 CSV files here is the link : https://www.transfernow.net/YuHkK6032021 athletes.csv contains basic information of each athlete and the number of medals they obtained in this Olympic Games. countries.csv contains the information of participating countries events.csv contains the information of the sport events in t his Olympic Games. You can use read_csv( ) function in pandas to help to read the files separately before doing the following exercises. You need to answer the following questions with Python and several Python packages we learned in this module (for example numpy , pandas , matplotlib).

(1) Try to count the number of athletes of Brazil and China by the type of sports. And calculate on which type of event s Brazil has the most athletes than China, and China than Brazil vice versa Make a table to show the type of events and the difference of the number. Tips: You can use .value_counts method to count the athletes by type of sports. Also, remember to deal with the types of events Brazil and China remember to deal with the types of events Brazil and China does not share.

(2) Try to plot out the number of medals obtained by the athletes of each generation (by 10 years). Tips: You may need pd.to_datetime to convert text to date time data so that you can find out the birth year, but there will be some error pushing back an earlier year by a century, which needs you to fix it. Or you can do by your own way to achieve the generations (by string operations etc. Use .groupby ( function to group the data separately by generations, and . to calculate the sum of medals in group

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!