1.7 Practice
See how well you have learned Pandas DataFrames by working on the practice problems below:
Next, we want to examine the age of each person in the DataFrame to see if they were born before the year 2000. For simplicity, assume that anyone age 20 or under was born in 2000 or later and anyone older than 20 was born before 2000. We also want this to work regardless of the number of people in the DataFrame. In other words, we need to loop through each record in the DataFrame one-at-a-time. We will then create a new column to state whether or not each person was born before the year 2000 (e.g., just put True or False in this column for each row).
You are creating a business to compete with Netflix, and you just acquired your first five movies. Create a DataFrame to store information about your movie collection: Movie Name, Rating, Run Time, and the mainGenre(s). Use the dataset below:
[['Remember the Titans','PG',113, 'Sport'], ['Forrest Gump', 'PG-13',142,'Drama'], ['Inception','PG-13',148,'Sci-Fi'], ['The Proposal','PG-13',108,'Romance'], ['Dumb & Dumber','PG-13',108,'Comedy']]