Skip to content

Commit f51bfca

Browse files
committed
DEPR: Raise warning frame.quantile with numeric_only
1 parent b9a7b8c commit f51bfca

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pandas/core/frame.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@
119119
is_integer_dtype,
120120
is_iterator,
121121
is_list_like,
122+
is_numeric_dtype,
122123
is_object_dtype,
123124
is_scalar,
124125
is_sequence,
@@ -10628,8 +10629,8 @@ def quantile(
1062810629
"""
1062910630
validate_percentile(q)
1063010631
axis = self._get_axis_number(axis)
10631-
10632-
if numeric_only is no_default:
10632+
any_not_numeric = any(not is_numeric_dtype(x) for x in self.dtypes)
10633+
if numeric_only is no_default and any_not_numeric:
1063310634
warnings.warn(
1063410635
"In future versions of pandas, numeric_only will be set to "
1063510636
"False by default, and the datetime/timedelta columns will "

0 commit comments

Comments
 (0)