BaşlayınÜcretsiz Başlayın

Concatenating rows

You and the team are ready to continue the project to reduce player concussions in the NFL. Previously you looked at game data from the 2016 and 2017 seasons and determined that the data should be joined. Among other things, it will help you to compare the number of games for each season by season type.

Games spreadsheet

Data from both seasons have been loaded into two data frames, games_2016 and games_2017. Please assume for this exercise and all remaining exercises, that pandas has been imported as pd.

Bu egzersiz

Pandas Joins for Spreadsheet Users

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • View each data frame to refresh your memory.
  • Concatenate the data frames by consecutive season.
  • Cross-tabulate Season and SeasonType with pd.crosstab().

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# View 2016 and 2017 games
print(____)
____(games_2017)

# Concatenate data frames
games = ____([____, ____])

# Cross-tabulate Season and Season Type
print(pd.crosstab(games.Season, games.SeasonType))
Kodu Düzenle ve Çalıştır