Skip to content

Commit 3efc274

Browse files
committed
Remove unnecessary if for string type
1 parent 0fb5a90 commit 3efc274

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
@@ -723,11 +723,8 @@ 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-
if na_rep is not None and isinstance(na_rep, (str, bytes)):
727-
itemsize = writers.max_len_string(na_rep)
728-
values = values.astype("<U{size}".format(size=itemsize))
729-
else:
730-
values = values.astype(str)
726+
itemsize = writers.max_len_string(na_rep)
727+
values = values.astype("<U{size}".format(size=itemsize))
731728
else:
732729
values = np.array(values, dtype='object')
733730

0 commit comments

Comments
 (0)