Question:easy

__________ will display the total number of values for each column or row of a DataFrame.

Show Hint

The method that counts non-missing values in each column or row is count().
Updated On: Oct 1, 2026
  • count()
  • tail(n)
  • head(n)
  • max(n)
Show Solution

The Correct Option is A

Solution and Explanation

Step 1: Idea:
We match each method name with the kind of output it produces. The sentence needs an output that is a number for each column or row, and that number is a total of values.

Step 2: Classify the four methods by their output.
head(n) and tail(n) return rows of the DataFrame, so their output is data. max() returns the biggest value, so its output is a value from the data. count() returns how many entries exist, so its output is a count.

Step 3: Compare with the sentence.
The sentence says total number of values. A total number is a count. Only count() returns a count.

Step 4: Quick example.
For a DataFrame with 3 rows where one column has one NaN, df.count() shows 3 for the full columns and 2 for that column. This is the per-column total of values.

Step 5: Conclusion.
Option 1 is correct. \[ \boxed{\text{count()}} \]
Was this answer helpful?
0


Questions Asked in CUET (UG) exam