Skip to content

Commit 25087f7

Browse files
committed
Brock feedback
1 parent 305fee3 commit 25087f7

File tree

2 files changed

+1
-23
lines changed

2 files changed

+1
-23
lines changed

pandas/_libs/lib.pyx

+1-2
Original file line numberDiff line numberDiff line change
@@ -834,8 +834,7 @@ cpdef ndarray[object] ensure_string_array(
834834
if isinstance(val, bytes):
835835
# GH#49658 discussion of desired behavior here
836836
result[i] = val.decode()
837-
elif isinstance(val, np.ndarray):
838-
# TODO(wayd): is_float_object actually returns true for this...
837+
elif util.is_array(val):
839838
result[i] = str(val.tolist())
840839
elif not util.is_float_object(val):
841840
# f"{val}" is faster than str(val)

pandas/io/formats/format.py

-21
Original file line numberDiff line numberDiff line change
@@ -1467,27 +1467,6 @@ def _format_strings(self) -> list[str]:
14671467
return fmt_values
14681468

14691469

1470-
class _NullFormatter(_GenericArrayFormatter):
1471-
def _format_strings(self) -> list[str]:
1472-
fmt_values = [str(x) for x in self.values]
1473-
return fmt_values
1474-
1475-
1476-
class _ListFormatter(_GenericArrayFormatter):
1477-
def _format_strings(self) -> list[str]:
1478-
# TODO(wayd): This doesn't seem right - where should missing values
1479-
# be handled
1480-
fmt_values = []
1481-
for x in self.values:
1482-
pyval = x.as_py()
1483-
if pyval:
1484-
fmt_values.append(pyval)
1485-
else:
1486-
fmt_values.append("")
1487-
1488-
return fmt_values
1489-
1490-
14911470
class _Datetime64Formatter(_GenericArrayFormatter):
14921471
values: DatetimeArray
14931472

0 commit comments

Comments
 (0)