I have a multi-index pandas DataFrame
with the following structure that I got from a groupby
operation:
count
year month day
2010 1 1 1
2 3
3 6
4 24
5 31
This continues for many days, months, and years. The DataFrame
has three indices (year
, month
, and day
).
What I'd like to do is use matplotlib
to plot the count
as a function of the date
. There are several examples online of plotting dates in matplotlib, so really what I need to do is:
Question:
1) How can I build a separate array or DataFrame
that is two columns, first column being the date
and second column being the count
?
What I tried
for idx, val in enumerate(df3.body):
print val
That only prints the values of count
row by row, but I'm not sure how to access the date
.