Skip to content

Commit

Permalink
Fix segfault with printing dataframe
Browse files Browse the repository at this point in the history
GH 46848
  • Loading branch information
roberthdevries committed May 23, 2022
1 parent d2a7eff commit 9981fb1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pandas/_libs/algos_take_helper.pxi.in
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,15 @@ def take_2d_axis1_{{name}}_{{dest}}(ndarray[{{c_type_in}}, ndim=2] values,
{{if c_type_in == "uint8_t" and c_type_out == "object"}}
out[i, j] = True if values[i, idx] > 0 else False
{{else}}
{{if c_type_in == "object"}} # GH46848
if values[i][idx] is None:
out[i, j] = None
else:
out[i, j] = values[i, idx]
{{else}}
out[i, j] = values[i, idx]
{{endif}}
{{endif}}


@cython.wraparound(False)
Expand Down

0 comments on commit 9981fb1

Please sign in to comment.