Skip to content

Commit 004e42f

Browse files
committed
fixup
1 parent e83a8a9 commit 004e42f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pandas/core/strings.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ def _map(f, arr, na_mask=False, na_value=np.nan, dtype=object):
123123
if na_mask:
124124
mask = isna(arr)
125125
convert = not np.all(mask)
126+
if convert:
127+
# NA -> nan
128+
arr[mask] = np.nan
129+
126130
try:
127131
result = lib.map_infer_mask(arr, f, mask.view(np.uint8), convert)
128132
except (TypeError, AttributeError) as e:

0 commit comments

Comments
 (0)