Skip to content

Commit bbe4306

Browse files
author
y-p
committed
BUG/ENH: (Multi)Index pprint items by type correctly, obeys display.max_seq_items GH3465
1 parent 0bd5e77 commit bbe4306

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

pandas/core/index.py

+2-17
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,7 @@ def __unicode__(self):
170170
171171
Invoked by unicode(df) in py2 only. Yields a Unicode String in both py2/py3.
172172
"""
173-
if len(self) > 6 and len(self) > np.get_printoptions()['threshold']:
174-
data = self[:3].format() + ["..."] + self[-3:].format()
175-
else:
176-
data = self.format()
177-
178-
prepr = com.pprint_thing(data, escape_chars=('\t', '\r', '\n'),quote_strings=True)
173+
prepr = com.pprint_thing(self, escape_chars=('\t', '\r', '\n'),quote_strings=True)
179174
return '%s(%s, dtype=%s)' % (type(self).__name__, prepr, self.dtype)
180175

181176
def __repr__(self):
@@ -1504,19 +1499,9 @@ def __unicode__(self):
15041499
"""
15051500
output = 'MultiIndex\n%s'
15061501

1507-
options = np.get_printoptions()
1508-
np.set_printoptions(threshold=50)
1509-
1510-
if len(self) > 100:
1511-
values = self[:50].format() + ["..."] + self[-50:].format()
1512-
else:
1513-
values = self.format()
1514-
1515-
summary = com.pprint_thing(values, escape_chars=('\t', '\r', '\n'),
1502+
summary = com.pprint_thing(self, escape_chars=('\t', '\r', '\n'),
15161503
quote_strings=True)
15171504

1518-
np.set_printoptions(threshold=options['threshold'])
1519-
15201505
return output % summary
15211506

15221507
def __repr__(self):

0 commit comments

Comments
 (0)