Skip to content

Commit f210701

Browse files
KhemkaranKhemkaran
authored andcommitted
modified error message in describe() to be more generalized
1 parent 8d5f769 commit f210701

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pandas/core/methods/describe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def _select_data(self) -> DataFrame:
200200
exclude=self.exclude,
201201
)
202202
if len(data.columns) == 0:
203-
msg = "None of the included dtypes are present in the DataFrame"
203+
msg = "No columns match the specified include or exclude data types"
204204
raise ValueError(msg)
205205
return data
206206

pandas/tests/frame/methods/test_describe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ def test_describe_when_include_all_exclude_not_allowed(self, exclude):
374374
def test_describe_when_included_dtypes_not_present(self):
375375
# GH#61863
376376
df = DataFrame({"a": [1, 2, 3]})
377-
msg = "None of the included dtypes are present in the DataFrame"
377+
msg = "No columns match the specified include or exclude data types"
378378
with pytest.raises(ValueError, match=msg):
379379
df.describe(include=["datetime"])
380380

0 commit comments

Comments
 (0)