Skip to content

Commit f169892

Browse files
Add similar fix as in take_2d_axis1_* to take_2d_axis0_*
1 parent 533f57e commit f169892

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pandas/_libs/algos_take_helper.pxi.in

+7
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,15 @@ def take_2d_axis0_{{name}}_{{dest}}(ndarray[{{c_type_in}}, ndim=2] values,
147147
{{if c_type_in == "uint8_t" and c_type_out == "object"}}
148148
out[i, j] = True if values[idx, j] > 0 else False
149149
{{else}}
150+
{{if c_type_in == "object"}} # GH46848
151+
if values[idx][j] is None:
152+
out[i, j] = None
153+
else:
154+
out[i, j] = values[idx, j]
155+
{{else}}
150156
out[i, j] = values[idx, j]
151157
{{endif}}
158+
{{endif}}
152159

153160

154161
@cython.wraparound(False)

0 commit comments

Comments
 (0)