We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fdba133 commit a833cc1Copy full SHA for a833cc1
pandas/core/generic.py
@@ -195,9 +195,12 @@ def __unicode__(self):
195
return '%s(%s)' % (self.__class__.__name__, prepr)
196
197
def _dir_additions(self):
198
- """ add the string-like attributes from the info_axis """
199
- additions = set([c for c in self._info_axis
200
- if isinstance(c, string_types) and isidentifier(c)])
+ """ add the string-like attributes from the info_axis.
+ If info_axis is a MultiIndex, it's first level values are used.
+ """
201
+ additions = set(
202
+ [c for c in self._info_axis.unique(level=0)[:100]
203
+ if isinstance(c, string_types) and isidentifier(c)])
204
return super(NDFrame, self)._dir_additions().union(additions)
205
206
@property
0 commit comments