I have a date field Datetime and I want a simple count of the items but i's like it in date order.. what I have now...
plot_data.Quradate.value_counts() # of respondents by survey date
2011-07-15 702
2011-04-15 696
2011-10-15 661
2010-01-15 636
2011-01-15 587
2010-10-15 570
2012-01-15 534
2010-07-15 525
2010-04-15 384
dtype: int64
Should be simple but not yet for me...
As Andy points out And (+TomAugspurger above) this is the right solution:
plot_data.Quradate.value_counts().sort_index()
Ugly, but gets the job done would like to see a better solution.
resp=pd.DataFrame(plot_data.Quradate.value_counts()) # of respondents by survey date
resp.sort_index()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With