-
-
Notifications
You must be signed in to change notification settings - Fork 18k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API: MultiIndex.get_level_values should have label only / level only mode? #10461
Comments
Maybe |
I think we can't change I think users prefer
|
already there is inference to figure out if they mean positional (if no integers are in the names) or label based - eg like ix but I have never seen this come up as a practical issue I guess get_ilevel_values would be fine ironically in .query we allow ilevel as a search term so this would be consistent at least |
just throwing it out there - could allow this: df.index.ix(0) #current or maybe df.index.ix[0] further this might be useful df.index.ix[0,1] -> grab first 2 levels |
Right. Adding |
I am -1 on adding |
This relates to #12223 and #15262 which are bugs due to allowing index names to be integers. For those, the issue is the internal use of
I think I am in favor of (2) as I actually think it gives a very small performance boost, but would like to hear the opinions of @jreback, @jorisvandenbossche and @sinhrks before I embark on making those changes. |
|
Currently,
MultiIndex.get_level_values
handles both names and levels, it return different levels depending on its name (like.ix
). Adding an option (or separate method) like.loc
and.iloc
to avoid any unexpected results?The text was updated successfully, but these errors were encountered: