How to group a Series by values in pandas?

后端 未结 5 1885
悲&欢浪女
悲&欢浪女 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:14

    For anyone else who wants to do this inline without throwing a lambda in (which tends to kill performance):

    s.to_frame(0).groupby(0)[0]
    

提交回复
热议问题