Skip to main contentSkip to solution

Which of the following function will display the descriptive statistical values in a single command?

Solution

✅ Correct Option: 4

describe() is a method of a pandas DataFrame (and Series), so it is called with a dot and parentheses as DataFrame.describe(). In one command it returns the count, mean, standard deviation, minimum, 25%, 50% (median), 75% and maximum for each numeric column.


Option 1: methods are called with round brackets, and square brackets are used for indexing, so this gives an error.

Option 2: describe() is not a top-level pandas function. It must be called on a DataFrame or Series object.

Option 3: the underscore makes DataFrame_describe a single undefined name, not a method call on the DataFrame.

Keyboard Shortcuts

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