Counting frequency of values by date using pandas

后端 未结 3 774
一个人的身影
一个人的身影 2020-12-28 16:00

Let\'s suppose I have following Time Series:

Timestamp              Category
2014-10-16 15:05:17    Facebook
2014-10-16 14:56:37    Vimeo
2014-10-16 14:25:16         


        
3条回答
  •  我在风中等你
    2020-12-28 16:35

    Convert your TimeStamp column to week number then groupby that week number and value_count the categorical variable like so:

    df.groupby('week_num').Category.value_counts()
    

    Where I have assumed that a new column week_num was created from the TimeStamp column.

提交回复
热议问题