The descriptive statistical function of pandas which is used to display the sum of the values of a DataFrame (df) regardless of its datatype is_______.
The descriptive statistical function of pandas which is used to display the sum of the values of a DataFrame (df) regardless of its datatype is_______.
Solution
✅ Correct Option: 2
df.sum() is the pandas descriptive statistic that returns the sum of the values in each column (or row, with axis=1). It works on any datatype, so for string columns it joins the values together instead of adding them.
df.add(): performs element-wise addition of another value or DataFrame to df; it does not total the values.
df.count(): returns the number of non-null entries, not their sum.
df.total(): not a pandas function.
Related questions:
2025: 14 May Shift 1
2025: 13 May Shift 2