Problem:
I have a list of ~108 dictionaries named list_of_dictionary
and I would like to use Matplotlib to generate line graphs.
The dictionaries have the following format (this is one of 108):
{'price': [59990,
59890,
60990,
62990,
59990,
59690],
'car': '2014 Land Rover Range Rover Sport',
'datetime': [datetime.datetime(2020, 1, 22, 11, 19, 26),
datetime.datetime(2020, 1, 23, 13, 12, 33),
datetime.datetime(2020, 1, 28, 12, 39, 24),
datetime.datetime(2020, 1, 29, 18, 39, 36),
datetime.datetime(2020, 1, 30, 18, 41, 31),
datetime.datetime(2020, 2, 1, 12, 39, 7)]
}
Understanding the dictionary:
The car
2014 Land Rover Range Rover Sport was priced at:
59990
ondatetime.datetime(2020, 1, 22, 11, 19, 26)
59890
ondatetime.datetime(2020, 1, 23, 13, 12, 33)
60990
ondatetime.datetime(2020, 1, 28, 12, 39, 24)
62990
ondatetime.datetime(2020, 1, 29, 18, 39, 36)
59990
ondatetime.datetime(2020, 1, 30, 18, 41, 31)
59690
ondatetime.datetime(2020, 2, 1, 12, 39, 7)
Question:
With this structure how could one create mini-graphs with matplotlib (say 11 rows x 10 columns)?
Where each mini-graph will have:
- the title of the graph frome
car
- x-axis from the
datetime
- y-axis from the
price
What I have tried:
df = pd.DataFrame(list_of_dictionary)
df = df.set_index('datetime')
print(df)
I don't know what to do thereafter...
Relevant Research:
- Plotting a column containing lists using Pandas
- Pandas column of lists, create a row for each list element
I've read these multiple times, but the more I read it, the more confused I get :(.