Skip to content

Commit da084ac

Browse files
author
Martin Journois
committed
TOSQUASH: ENH: _dir_additions returns only the 100 first values of the index' first level
1 parent 2424286 commit da084ac

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pandas/core/generic.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,9 @@ def _dir_additions(self):
197197
""" add the string-like attributes from the info_axis.
198198
If info_axis is a MultiIndex, it's first level values are used.
199199
"""
200-
additions = set([c for c in self._info_axis.get_level_values(0)
201-
if isinstance(c, string_types) and isidentifier(c)])
200+
additions = set(
201+
[c for c in self._info_axis.unique(level=0)[:100]
202+
if isinstance(c, string_types) and isidentifier(c)])
202203
return super(NDFrame, self)._dir_additions().union(additions)
203204

204205
@property

0 commit comments

Comments
 (0)