Exercise: Data Types
Use the concepts you’ve learned so far to solve this exercise.
We'll cover the following...
Consider the following dataset:
Press + to interact
import pandas as pdimport altair as altimport osdata = [{'Fruit': 'Orange', 'Quantity' : 5 , 'Year' : 1990},{'Fruit': 'Apple', 'Quantity' : 2 , 'Year' : 1990},{'Fruit': 'Water Melon', 'Quantity' : 4 , 'Year' : 1990},{'Fruit': 'Orange', 'Quantity' : 7 , 'Year' : 2020},{'Fruit': 'Apple', 'Quantity' : 5 , 'Year' : 2020},{'Fruit': 'Water Melon', 'Quantity' : 6 , 'Year' : 2020},{'Fruit': 'Orange', 'Quantity' : 10 , 'Year' : 2022},{'Fruit': 'Apple', 'Quantity' : 3 , 'Year' : 2022},{'Fruit': 'Water Melon', 'Quantity' : 8 , 'Year' : 2022},{'Fruit': 'Orange', 'Quantity' : 4 , 'Year' : 2023},{'Fruit': 'Apple', 'Quantity' : 6 , 'Year' : 2023},{'Fruit': 'Water Melon', 'Quantity' : 10 , 'Year' : 2023},]df = pd.DataFrame(data)print(df)
The ...