Skip to content

Commit 1c7460a

Browse files
committed
Use approach again that specifies the type length
1 parent 9a16147 commit 1c7460a

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
@@ -723,12 +723,12 @@ def to_native_types(self, slicer=None, na_rep='nan', quoting=None,
723723
mask = isna(values)
724724

725725
if not self.is_object and not quoting:
726-
values[mask] = na_rep
727-
values = values.astype(str)
726+
itemsize = writers.max_len_string(na_rep)
727+
values = values.astype("<U{size}".format(size=itemsize))
728728
else:
729729
values = np.array(values, dtype='object')
730-
values[mask] = na_rep
731730

731+
values[mask] = na_rep
732732
return values
733733

734734
# block actions ####

0 commit comments

Comments
 (0)