Ask a question about the groupby function

CSDN Q & A 2022-05-15 04:47:26 阅读数:474

askquestiongroupbyfunction

The problem is that :

img


How to use groupby, obtain
class 1 2
Gender
male 180 170
Woman 160 161
( The values in the table are the median height )




Take the answer :

df.groupby([' class ',' Gender ']).median()[' height ']


版权声明:本文为[CSDN Q & A]所创,转载请带上原文链接,感谢。 https://primo.wiki/2022/131/202205041640262492.html