Skip to content

Commit a784237

Browse files
committed
DEPR: Raise warning frame.quantile with numeric_only
1 parent d603c85 commit a784237

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
@@ -120,6 +120,7 @@
120120
is_integer_dtype,
121121
is_iterator,
122122
is_list_like,
123+
is_numeric_dtype,
123124
is_object_dtype,
124125
is_scalar,
125126
is_sequence,
@@ -10595,8 +10596,8 @@ def quantile(
1059510596
"""
1059610597
validate_percentile(q)
1059710598
axis = self._get_axis_number(axis)
10598-
10599-
if numeric_only is no_default:
10599+
any_not_numeric = any(not is_numeric_dtype(x) for x in self.dtypes)
10600+
if numeric_only is no_default and any_not_numeric:
1060010601
warnings.warn(
1060110602
"In future versions of pandas, numeric_only will be set to "
1060210603
"False by default, and the datetime/timedelta columns will "

0 commit comments

Comments
 (0)