From 7b8e0779ffbcdf3cb716de8d0ab0e44e922bf30a Mon Sep 17 00:00:00 2001 From: Brock Date: Wed, 20 Aug 2025 16:08:11 -0700 Subject: [PATCH] REF: avoid inferred_type checks in plotting --- doc/redirects.csv | 1 - pandas/plotting/_core.py | 2 +- pandas/plotting/_matplotlib/core.py | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/redirects.csv b/doc/redirects.csv index c11e4e242f128..2d72dbca8816f 100644 --- a/doc/redirects.csv +++ b/doc/redirects.csv @@ -643,7 +643,6 @@ generated/pandas.Index.get_slice_bound,../reference/api/pandas.Index.get_slice_b generated/pandas.Index.groupby,../reference/api/pandas.Index.groupby generated/pandas.Index.has_duplicates,../reference/api/pandas.Index.has_duplicates generated/pandas.Index.hasnans,../reference/api/pandas.Index.hasnans -generated/pandas.Index.holds_integer,../reference/api/pandas.Index.holds_integer generated/pandas.Index,../reference/api/pandas.Index generated/pandas.Index.identical,../reference/api/pandas.Index.identical generated/pandas.Index.inferred_type,../reference/api/pandas.Index.inferred_type diff --git a/pandas/plotting/_core.py b/pandas/plotting/_core.py index 9670b5439c87e..f16323e0337bf 100644 --- a/pandas/plotting/_core.py +++ b/pandas/plotting/_core.py @@ -46,7 +46,7 @@ def holds_integer(column: Index) -> bool: - return column.inferred_type in {"integer", "mixed-integer"} + return column.dtype.kind in "iu" def hist_series( diff --git a/pandas/plotting/_matplotlib/core.py b/pandas/plotting/_matplotlib/core.py index 1c7e1ab57b2a9..a7944ba301e68 100644 --- a/pandas/plotting/_matplotlib/core.py +++ b/pandas/plotting/_matplotlib/core.py @@ -101,7 +101,7 @@ def holds_integer(column: Index) -> bool: - return column.inferred_type in {"integer", "mixed-integer"} + return column.dtype.kind in "iu" def _color_in_style(style: str) -> bool: