How to preview rows after using .groupby() on a Pandas df/series

前端 未结 2 1191
滥情空心
滥情空心 2021-01-25 00:15

After using df.groupby(df.index.month) I would like to preview my DataFrame unfortunately .head removes the group formatting and df[

2条回答
  •  北海茫月
    2021-01-25 01:09

    you can loop through test

    test = df.groupby("columnTitle")
    for each in test:
        print each[0] #columnTitle value
        print each[1] #corresponding df equivalent of df[df['columnTitle']==each[0]]
    

提交回复
热议问题