We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1eedcf6 commit 9cba8f3Copy full SHA for 9cba8f3
pandas/core/generic.py
@@ -194,8 +194,10 @@ def __unicode__(self):
194
return '%s(%s)' % (self.__class__.__name__, prepr)
195
196
def _dir_additions(self):
197
- """ add the string-like attributes from the info_axis """
198
- additions = set([c for c in self._info_axis
+ """ add the string-like attributes from the info_axis.
+ If info_axis is a MultiIndex, it's first level values are used.
199
+ """
200
+ additions = set([c for c in self._info_axis.get_level_values(0)
201
if isinstance(c, string_types) and isidentifier(c)])
202
return super(NDFrame, self)._dir_additions().union(additions)
203
0 commit comments