Skip to content

Commit 5291064

Browse files
Terji Petersentopper-123
Terji Petersen
authored andcommitted
use _holds_integer in plotting._core.py
1 parent 5a53f93 commit 5291064

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/plotting/_core.py

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

0 commit comments

Comments
 (0)