How to group a Series by values in pandas?

后端 未结 5 1884
悲&欢浪女
悲&欢浪女 2021-02-01 00:31

I currently have a pandas Series with dtype Timestamp, and I want to group it by date (and have many rows with different times in each group).

5条回答
  •  礼貌的吻别
    2021-02-01 01:03

    To add another suggestion, I often use the following as it uses simple logic:

    pd.Series(index=s.values).groupby(level=0)
    

提交回复
热议问题