Skip to main contentSkip to solution

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.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question