Skip to content

Commit 5d5bda6

Browse files
y-pwesm
y-p
authored andcommitted
ENH: eliminate _str() in favor of pprint_thing
1 parent 6b09390 commit 5d5bda6

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

pandas/core/format.py

+2-9
Original file line numberDiff line numberDiff line change
@@ -406,13 +406,6 @@ def _get_column_name_list(self):
406406
names.append('' if columns.name is None else columns.name)
407407
return names
408408

409-
410-
def _str(x):
411-
if not isinstance(x, basestring):
412-
return str(x)
413-
return x
414-
415-
416409
class HTMLFormatter(object):
417410

418411
indent_delta = 2
@@ -437,7 +430,7 @@ def _maybe_bold_row(x):
437430
self._maybe_bold_row = _maybe_bold_row
438431

439432
def write(self, s, indent=0):
440-
self.elements.append(' ' * indent + _str(s))
433+
self.elements.append(' ' * indent + com.pprint_thing(s))
441434

442435
def write_th(self, s, indent=0, tags=None):
443436
return self._write_cell(s, kind='th', indent=indent, tags=tags)
@@ -450,7 +443,7 @@ def _write_cell(self, s, kind='td', indent=0, tags=None):
450443
start_tag = '<%s %s>' % (kind, tags)
451444
else:
452445
start_tag = '<%s>' % kind
453-
self.write('%s%s</%s>' % (start_tag, _str(s), kind), indent)
446+
self.write('%s%s</%s>' % (start_tag, com.pprint_thing(s), kind), indent)
454447

455448
def write_tr(self, line, indent=0, indent_delta=4, header=False,
456449
align=None, tags=None):

0 commit comments

Comments
 (0)