Skip to content

Commit 4f286ca

Browse files
authored
REF: avoid inferred_type checks in plotting (#62160)
1 parent 9c5ce1f commit 4f286ca

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

doc/redirects.csv

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,6 @@ generated/pandas.Index.get_slice_bound,../reference/api/pandas.Index.get_slice_b
643643
generated/pandas.Index.groupby,../reference/api/pandas.Index.groupby
644644
generated/pandas.Index.has_duplicates,../reference/api/pandas.Index.has_duplicates
645645
generated/pandas.Index.hasnans,../reference/api/pandas.Index.hasnans
646-
generated/pandas.Index.holds_integer,../reference/api/pandas.Index.holds_integer
647646
generated/pandas.Index,../reference/api/pandas.Index
648647
generated/pandas.Index.identical,../reference/api/pandas.Index.identical
649648
generated/pandas.Index.inferred_type,../reference/api/pandas.Index.inferred_type

pandas/plotting/_core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747

4848
def holds_integer(column: Index) -> bool:
49-
return column.inferred_type in {"integer", "mixed-integer"}
49+
return column.dtype.kind in "iu"
5050

5151

5252
def hist_series(

pandas/plotting/_matplotlib/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101

102102

103103
def holds_integer(column: Index) -> bool:
104-
return column.inferred_type in {"integer", "mixed-integer"}
104+
return column.dtype.kind in "iu"
105105

106106

107107
def _color_in_style(style: str) -> bool:

0 commit comments

Comments
 (0)