Skip to content

Commit 33aa7e5

Browse files
committed
don't copy for categorical data
1 parent cced3c9 commit 33aa7e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/core/arrays/integer.py

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

209209

210210
if hasattr(values, "dtype"):
211-
if copy:
211+
if copy and values.dtype!="category":
212212
values = values.copy()
213213
else:
214214
if isinstance(values, list):

0 commit comments

Comments
 (0)