Pandas - groupby one column before getting the mean of all columns

后端 未结 0 516
误落风尘
误落风尘 2021-02-02 10:04

If I want to take the mean of all my columns:

col = [\'id\', \'A\', \'B\', \'C\']

I can do:

df[col].mean(axis=1, skipna=True)


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题