Skip to content

Commit cd15bda

Browse files
committed
fix conditions
1 parent f29fa25 commit cd15bda

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pandas/core/arrays/integer.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,9 @@ def coerce_to_array(values, dtype, mask=None, copy=False):
208208

209209

210210
if hasattr(values, "dtype"):
211-
if copy and not isinstance(values, Categorical):
211+
if isinstance(values, Categorical):
212+
values = np.array(values, copy=copy)
213+
elif copy:
212214
values = values.copy()
213215
else:
214216
if isinstance(values, list):

0 commit comments

Comments
 (0)