What is the difference between sum() and count() in pandas?

后端 未结 3 1452
天涯浪人
天涯浪人 2020-12-12 00:44

Can you help me understand the difference between the statements mentioned below? Given that Survived column contains binary data (0,1), they give different ans

3条回答
  •  伪装坚强ぢ
    2020-12-12 01:19

    sum() is for like 1+0 = 1. if data is 3 and 3 then it return 6.

    count() return number of row. so it will return 2.

    simple :)

提交回复
热议问题