Session Ready
Exercise

Mixing indexes and columns

It's time to look more into player safety! But first, you and the team want to settle a bet on the correlation between (1) the draft round in which a player was chosen and (2) current salary. You were able to find relevant player data from a fantasy football web site through it's API. As is common with APIs, the data returned to you is in JSON format.

The first file has already been loaded to a data frame called current. You will be loading a second file, draft.json. As the filename implies, the data file is in JSON format.

Instructions
100 XP
  • View the first 5 rows of current.
  • Load draft.json using pd.read_json() and view the first 5 rows.
  • Merge the two data frames on player_id, noting whether it's the index or a data column.
  • Create a scatter plot of 'draft_round' vs. 'salary_millions'.