You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pandas has quite big tolerrance of names setting, however, if names is set by int, and happens to be valid position, then using set_levels to change level value could be confusing, and also using level name to only change level values for None becomes difficult, because by default, None should be used to set values for all levels, the same happens if names is [0, 1], e.g.
And yes, these are really corner cases, but might be nice to resolve to let users explicitly set/get level values! I am not sure what is the best way to figure it out, I am thinking of something like: get_level_values_by_name(0) or get_level_values_by_loc(0), or have an argument in get_level_values, e.g. get_level_values(0, by_name=True), default is False which uses loc to get values.
While working on a PR, find out a confusion when level names are integer/None, e.g.
Pandas has quite big tolerrance of names setting, however, if names is set by int, and happens to be valid position, then using
set_levels
to change level value could be confusing, and also using level name to only change level values forNone
becomes difficult, because by default,None
should be used to set values for all levels, the same happens if names is[0, 1]
, e.g.And yes, these are really corner cases, but might be nice to resolve to let users explicitly set/get level values! I am not sure what is the best way to figure it out, I am thinking of something like:
get_level_values_by_name(0)
orget_level_values_by_loc(0)
, or have an argument inget_level_values
, e.g.get_level_values(0, by_name=True)
, default isFalse
which uses loc to get values.All feedbacks are very welcome, if there is kind of consensus, i would like to work on it!
@jreback @WillAyd @TomAugspurger @jorisvandenbossche
The text was updated successfully, but these errors were encountered: