Skip to content

Commit 6e0dd9c

Browse files
committed
Use approach again that specifies the type length
1 parent 67bb04a commit 6e0dd9c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pandas/core/internals/blocks.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -726,12 +726,12 @@ def to_native_types(self, slicer=None, na_rep='nan', quoting=None,
726726
mask = isna(values)
727727

728728
if not self.is_object and not quoting:
729-
values[mask] = na_rep
730-
values = values.astype(str)
729+
itemsize = writers.max_len_string(na_rep)
730+
values = values.astype("<U{size}".format(size=itemsize))
731731
else:
732732
values = np.array(values, dtype='object')
733-
values[mask] = na_rep
734733

734+
values[mask] = na_rep
735735
return values
736736

737737
# block actions ####

0 commit comments

Comments
 (0)