Plot Datetime.date Pandas
I created a pandas dataframe from some value counts on particular calendar dates. Here is how I did it: time_series = pd.DataFrame(df['Operation Date'].value_counts().reset_index()
Solution 1:
you sure you got datetime? i just tried this and it worked fine:
df=datecount72012-06-11 16:51:32 1.032012-09-28 08:05:14 12.0192012-10-01 18:01:47 4.022012-10-03 15:18:23 29.062012-12-22 19:50:43 4.012013-02-19 19:54:03 28.092013-02-28 16:08:40 17.0122013-03-12 08:42:55 6.042013-04-04 05:27:27 6.0172013-04-18 09:40:37 29.0112013-05-17 16:34:51 22.052013-07-07 14:32:59 16.0142013-10-22 06:56:29 13.0132014-01-16 23:08:46 20.0152014-02-25 00:49:26 10.0182014-03-19 15:58:38 25.002014-03-31 05:53:28 16.0162014-04-01 09:59:32 27.082014-04-27 12:07:41 17.0102014-09-20 04:42:39 21.0df=df.sort_values('date',ascending=True)plt.plot(df['date'],df['count'])plt.xticks(rotation='vertical')
EDIT:
if you want a scatter plot you can:
plt.plot(df['date'], df['count'], '*')
plt.xticks(rotation='vertical')
Post a Comment for "Plot Datetime.date Pandas"