Skip to content

Commit c413133

Browse files
committed
Remove unnecessary if for string type
1 parent 548dd8c commit c413133

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
@@ -726,11 +726,8 @@ 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-
if na_rep is not None and isinstance(na_rep, (str, bytes)):
730-
itemsize = writers.max_len_string(na_rep)
731-
values = values.astype("<U{size}".format(size=itemsize))
732-
else:
733-
values = values.astype(str)
729+
itemsize = writers.max_len_string(na_rep)
730+
values = values.astype("<U{size}".format(size=itemsize))
734731
else:
735732
values = np.array(values, dtype='object')
736733

0 commit comments

Comments
 (0)