-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG/API: index.array for RangeIndex, MultiIndex #37277
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
Labels
Comments
@TomAugspurger @jorisvandenbossche thoughts here on adding something like a |
I don't have a strong opinion about it, but so that would basically the same as:
So it would save one line of boiler plate in every place where it is needed |
Agreed that extract_array shouldn't materialize a PandasArray from a
RangeIndex. IMO, it should only... extract, existing arrays. Not create new
ones :)
…On Tue, Oct 27, 2020 at 2:34 AM Joris Van den Bossche < ***@***.***> wrote:
I don't have a strong opinion about it, but so that would basically the
same as:
arr = ...
if not isinstance(arr, MultiIndex):
arr = extract_array(arr)
So it would save one line of boiler plate in every place where it is needed
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#37277 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKAOIXGQIAJ6CA7HKHVFKDSMZZYHANCNFSM4SYRTYOQ>
.
|
2 tasks
2 tasks
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ATM MultiIndex.array raises ValueError, since there is no single array actually backing MI. RangeIndex creates and returns a PandasArray. I think RangeIndex should also raise (at least until/unless we implement a RangeArray).
This also has implications for extract_array, which currently raises on MultiIndex, which has led to some ugly checks in e.g. Index._cmp_method.
The text was updated successfully, but these errors were encountered: