-
-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
Milestone
Description
In [140]: s = pd.Series(list('abcd'), name=('foo', 1))
In [141]: s
Out[141]: ---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
...
.../pandas/core/format.pyc in _get_footer(self)
86 series_name = self.series.name
87 elif isinstance(self.series.name, tuple):
---> 88 series_name = "('%s')" % "', '".join(self.series.name)
89 else:
90 series_name = str(self.series.name)
TypeError: sequence item 1: expected string, int found
Found the issue when indexing a MultiIndexed frame.
In [142]: mi = pd.MultiIndex.from_tuples([('foo', 1), ('foo', 2)])
In [143]: df = pd.DataFrame(np.random.randn(2,2), index=mi)
In [144]: df.ix[('foo', 1)]
Out[144]: ---------------------------------------------------------------------------
TypeError Traceback (most recent call last)