diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 473f69591aa70..bd7b7789cc0b6 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -11764,7 +11764,7 @@ def count(self, axis: Axis = 0, numeric_only: bool = False) -> Series: axis : {0 or 'index', 1 or 'columns'}, default 0 If 0 or 'index' counts are generated for each column. If 1 or 'columns' counts are generated for each row. - numeric_only : bool, default False + numeric_only : bool, default False. Include only `float`, `int` or `boolean` data. Returns diff --git a/pandas/tests/frame/methods/test_select_dtypes.py b/pandas/tests/frame/methods/test_select_dtypes.py index 0354e9df3d168..d18f45ef63dcd 100644 --- a/pandas/tests/frame/methods/test_select_dtypes.py +++ b/pandas/tests/frame/methods/test_select_dtypes.py @@ -483,3 +483,10 @@ def test_select_dtypes_no_view(self): result = df.select_dtypes(include=["number"]) result.iloc[0, 0] = 0 tm.assert_frame_equal(df, df_orig) + + def test_select_dtypes_empty_frame(): + # Test that select_dtypes works on a completely empty DataFrame + df = DataFrame() + result = df.select_dtypes(include="int64") + expected = DataFrame() + tm.assert_frame_equal(result, expected)