Skip to content

Commit 46c59a4

Browse files
Terji PetersenTerji Petersen
Terji Petersen
authored and
Terji Petersen
committed
use _holds_integer in plotting._core.py
1 parent 70fbf4d commit 46c59a4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/plotting/_core.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -939,15 +939,15 @@ def __call__(self, *args, **kwargs):
939939
f"{kind} requires either y column or 'subplots=True'"
940940
)
941941
if y is not None:
942-
if is_integer(y) and data.columns._should_fallback_to_positional:
942+
if is_integer(y) and not data.columns._holds_integer():
943943
y = data.columns[y]
944944
# converted to series actually. copy to not modify
945945
data = data[y].copy()
946946
data.index.name = y
947947
elif isinstance(data, ABCDataFrame):
948948
data_cols = data.columns
949949
if x is not None:
950-
if is_integer(x) and data.columns._should_fallback_to_positional:
950+
if is_integer(x) and not data.columns._holds_integer():
951951
x = data_cols[x]
952952
elif not isinstance(data[x], ABCSeries):
953953
raise ValueError("x must be a label or position")

0 commit comments

Comments
 (0)