Skip to content

Commit be5dd09

Browse files
kinowBruno P. Kinoshita
authored and
Bruno P. Kinoshita
committed
Remove unnecessary if for string type
1 parent b9c8a24 commit be5dd09

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

pandas/core/internals/blocks.py

Lines changed: 2 additions & 5 deletions
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)