-
-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
REF: Index.__new__ #38665
REF: Index.__new__ #38665
Conversation
…f-share-constructors
…f-share-constructors
pandas/core/indexes/base.py
Outdated
|
||
elif inferred in ["floating", "mixed-integer-float", "integer-na"]: | ||
# TODO: Returns IntegerArray for integer-na case in the future | ||
return subarr, np.float64 | ||
data = np.asarray(subarr).astype(np.float64) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copy=False
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated+green
if not isinstance(data, (np.ndarray, Index)): | ||
# Coerce to ndarray if not already ndarray or Index |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can use _ensure_array on L81
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
L81 is inside ensure_array
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh i c, i guess i meant can you use the super class version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
theres really only one line that gets shared, i dont think its worth it (for now at least)
…f-share-constructors
Aiming towards sharing more of this with Series and pd.array