Skip to content

Commit 508dd1e

Browse files
committed
Fixed assignment of categoricals
1 parent e32d5be commit 508dd1e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/_libs/parsers.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,8 +1298,8 @@ cdef class TextReader:
12981298
elif not cats.is_monotonic_increasing:
12991299
# sort categories and recode if necessary
13001300
unsorted = cats.copy()
1301-
cats = cats.sort_values()
1302-
indexer = cats.get_indexer(unsorted)
1301+
categories = cats.sort_values()
1302+
indexer = categories.get_indexer(unsorted)
13031303
codes = take_1d(indexer, codes, fill_value=-1)
13041304
ordered = False
13051305
else:

0 commit comments

Comments
 (0)