In Pandas, after groupby the grouped column is gone

前端 未结 4 597
萌比男神i
萌比男神i 2021-01-04 09:48

I have the following dataframe named ttm:

    usersidid   clienthostid    eventSumTotal   LoginDaysSum    score
0       12          1               60                


        
4条回答
  •  说谎
    说谎 (楼主)
    2021-01-04 10:45

    Reading the groupy documentarion, a found out that automatic exclusion of columns after groupby usually caused by the presence of null values in that columns excluded.

    Try fill the 'null' with some value.

    Like this:

    df.fillna('')
    

提交回复
热议问题