Averaging Python Pandas Date format -


i have data format below:

2016-06-02 22:00:00  2016-06-02 22:00:01  2016-06-02 22:00:01  2016-06-02 22:00:02  2016-06-02 22:00:02 

this data in pandas dataframe, , want averagint days, this:

2016-06-2  300  

so calculate how many items, averaged this.

any ideas? tried use value_counts, gave false result.

it seems need:

df = df['date'].dt.date.value_counts() 

or:

df = df.groupby(df['date'].dt.date).size() 

Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -