Exercises: Pandas
Time to Test Your Skills!
Note: We are going to create a DataFrame called “df” in the first exercise, and we will keep referring to the same DataFrame as our input in the rest of the exercises.
...
import pandas as pd# Inputdata = {'Artist': ['Ariana Grande', 'Taylor Swift', 'Ed Sheeran', 'Justin Bieber', 'Lady Gaga', 'Bruno Mars'],'Genre': ['Jazz', 'Rock', 'Jazz', 'Pop', 'Pop', 'Rock'],'Listeners': [1300000, 2700000, 5000000, 2000000, 3000000, 1100000]}labels = ['AG', 'TS', 'ED', 'JB', 'LG', 'BM']# Your solution goes here# Uncomment the print statement once done# print(df)
...
Access this course and 1400+ top-rated courses and projects.