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
Post a Comment