LoslegenKostenlos loslegen

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.

Diese Übung ist Teil des Kurses

Pandas Joins for Spreadsheet Users

Kurs anzeigen

Anleitung zur Übung

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

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# 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'))
Code bearbeiten und ausführen