Get startedGet started for free

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.

This exercise is part of the course

Pandas Joins for Spreadsheet Users

View Course

Exercise 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.

Hands-on interactive exercise

Have a go at this exercise by completing this sample 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'))
Edit and Run Code