Skip to content

Commit e8b21d6

Browse files
committed
Remove unnecessary if for string type
1 parent bc60a53 commit e8b21d6

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

pandas/core/internals/blocks.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -739,11 +739,8 @@ def to_native_types(self, slicer=None, na_rep='nan', quoting=None,
739739
mask = isna(values)
740740

741741
if not self.is_object and not quoting:
742-
if na_rep is not None and isinstance(na_rep, (str, bytes)):
743-
itemsize = writers.max_len_string(na_rep)
744-
values = values.astype("<U{size}".format(size=itemsize))
745-
else:
746-
values = values.astype(str)
742+
itemsize = writers.max_len_string(na_rep)
743+
values = values.astype("<U{size}".format(size=itemsize))
747744
else:
748745
values = np.array(values, dtype='object')
749746

0 commit comments

Comments
 (0)