Skip to content

Commit

Permalink
TOSQUASH: ENH: _dir_additions returns only the 100 first values of th…
Browse files Browse the repository at this point in the history
…e index' first level
  • Loading branch information
Martin Journois committed Dec 5, 2017
1 parent 2424286 commit da084ac
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,9 @@ def _dir_additions(self):
""" add the string-like attributes from the info_axis.
If info_axis is a MultiIndex, it's first level values are used.
"""
additions = set([c for c in self._info_axis.get_level_values(0)
if isinstance(c, string_types) and isidentifier(c)])
additions = set(
[c for c in self._info_axis.unique(level=0)[:100]
if isinstance(c, string_types) and isidentifier(c)])
return super(NDFrame, self)._dir_additions().union(additions)

@property
Expand Down

0 comments on commit da084ac

Please sign in to comment.