Skip to content

Commit cf4a4ad

Browse files
kinowBruno P. Kinoshita
authored andcommitted
Remove unnecessary if for string type
1 parent d740009 commit cf4a4ad

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
@@ -749,11 +749,8 @@ def to_native_types(self, slicer=None, na_rep="nan", quoting=None, **kwargs):
749749
mask = isna(values)
750750

751751
if not self.is_object and not quoting:
752-
if na_rep is not None and isinstance(na_rep, (str, bytes)):
753-
itemsize = writers.max_len_string(na_rep)
754-
values = values.astype("<U{size}".format(size=itemsize))
755-
else:
756-
values = values.astype(str)
752+
itemsize = writers.max_len_string(na_rep)
753+
values = values.astype("<U{size}".format(size=itemsize))
757754
else:
758755
values = np.array(values, dtype="object")
759756

0 commit comments

Comments
 (0)