Skip to content

Commit 69701f2

Browse files
committed
Clarified comment
1 parent 3a98ede commit 69701f2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pandas/core/arrays/categorical.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1780,9 +1780,9 @@ def take_nd(self, indexer, allow_fill=None, fill_value=None):
17801780
warn(_take_msg, FutureWarning, stacklevel=2)
17811781
allow_fill = True
17821782

1783-
if fill_value is None or isna(fill_value):
1784-
# The isna(fill_value) is included for backwards compatability.
1785-
# Categorical overrides any NA value with -1.
1783+
if isna(fill_value):
1784+
# For categorical, any NA value is considered a user-facing
1785+
# NA value. Our storage NA value is -1.
17861786
fill_value = -1
17871787

17881788
codes = take(self._codes, indexer, allow_fill=allow_fill,

0 commit comments

Comments
 (0)