DataFrame.max() is used to calculate the maximum values from the DataFrame, regardless of its data types. If we want to output maximum value for the columns having only numeric values, then we can set the parameter numeric_only as ___ in the max() method.
DataFrame.max() is used to calculate the maximum values from the DataFrame, regardless of its data types. If we want to output maximum value for the columns having only numeric values, then we can set the parameter numeric_only as ___ in the max() method.
Solution
The parameter numeric_only in pandas is a Boolean. When it is set to True, max() considers only columns with numeric values (int, float, bool) and ignores the rest.
Example:
Option 4: False does not filter columns, so non-numeric columns are included in the calculation.
Options 2 and 3: numeric_only accepts only a Boolean value (True or False), not a data type name.
Related questions:
2025: 16 May Shift 1
2026: 19 May Shift 1
2026: 21 May Shift 1
2025: 20 May Shift 1