Dictionary of lists
Some more data just came in! This time, you'll use the dictionary of lists method, parsing the data column by column.
date | small_sold | large_sold |
---|---|---|
"2019-11-17" | 10859987 | 7674135 |
"2019-12-01" | 9291631 | 6238096 |
pandas
as pd
is imported.
This exercise is part of the course
Data Manipulation with pandas
Exercise instructions
- Create a dictionary of lists with the new data called
avocados_dict
. - Convert the dictionary to a DataFrame called
avocados_2019
. - Print your new DataFrame.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Create a dictionary of lists with new data
avocados_dict = {
"____": [____],
"____": [____],
"____": [____]
}
# Convert dictionary into DataFrame
avocados_2019 = ____
# Print the new DataFrame
____