Skip to content

Commit 2d0a840

Browse files
author
y-p
committed
BUG: fix pprinting of singleton tuples GH3291
closes #3291
1 parent 2c81846 commit 2d0a840

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pandas/core/common.py

+3
Original file line numberDiff line numberDiff line change
@@ -1806,6 +1806,9 @@ def _pprint_seq(seq, _nest_lvl=0, **kwds):
18061806
for e in seq[:nitems])
18071807
if nitems < len(seq):
18081808
body+= ", ..."
1809+
elif isinstance(seq,tuple) and len(seq) == 1:
1810+
body += ','
1811+
18091812
return fmt % body
18101813

18111814

pandas/tests/test_common.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ def test_pprint_thing():
308308
# escape embedded tabs in string
309309
# GH #2038
310310
assert not "\t" in pp_t("a\tb", escape_chars=("\t",))
311-
311+
assert(pp_t((1,)) == u'(1,)')
312312

313313
class TestTake(unittest.TestCase):
314314

0 commit comments

Comments
 (0)