CommencerCommencer gratuitement

Dealing with different names

It might be useful to see average temperatures for each season type - pre, regular, and post. You get good news and (sort of) bad news from the weather team…They found data for both the 2016 and 2017 seasons. However, it looks like they changed their naming convention since you got the last file. You'll need to adjust your code before producing temperatures.

The games_places data frame is loaded along with a new weather data frame, weather_new.

Cet exercice fait partie du cours

Pandas Joins for Spreadsheet Users

Afficher le cours

Instructions

  • View the first 5 rows of games_places and the first 5 rows of weather_new.
  • Join the data to include only games contained in both datasets.
  • View the average temperatures by season type.

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# View the first 5 rows of each data frame
print(____)
print(____)

# Join data frames
games_weather = games_places.____(____, left_on=____, 
                    right_on=____, how=____)

# View average temperatures
print(games_weather.pivot_table(values='Temperature', index='SeasonType'))
Modifier et exécuter le code