Skip to content

Commit 456a932

Browse files
author
Martin Journois
committed
ENH: _dir_additions returns also the first level of a MultiIndex
1 parent 0607e03 commit 456a932

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pandas/core/generic.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,11 @@ def __unicode__(self):
190190
def _dir_additions(self):
191191
""" add the string-like attributes from the info_axis """
192192
return set([c for c in self._info_axis
193-
if isinstance(c, string_types) and isidentifier(c)])
193+
if isinstance(c, string_types) and isidentifier(c)] +
194+
[c[0] for c in self._info_axis
195+
if isinstance(c, tuple) and
196+
isinstance(c[0], string_types) and
197+
isidentifier(c[0])])
194198

195199
@property
196200
def _constructor_sliced(self):

0 commit comments

Comments
 (0)