-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
DEPR: move NumericIndexes into base Index, part 1 #49494
DEPR: move NumericIndexes into base Index, part 1 #49494
Conversation
looks like a couple of sparse tests are failing |
Yeah, test suite passed locally, trying to figure out what's the difference. Probably I need to install some package locally, so tests are skipped locally. UPDATE: everything passes locally still, so I'm a bit stomped why this fails in Github. I'll look again tomorrow. |
882fb9a
to
3ab66a9
Compare
3ab66a9
to
122a2b9
Compare
@@ -1582,7 +1582,7 @@ def _equal_values(self: BlockManager, other: BlockManager) -> bool: | |||
def quantile( | |||
self: T, | |||
*, | |||
qs: Float64Index, | |||
qs: NumericIndex, |
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.
comment about dtype?
Closing in favor of #49560. |
A part of the changes in pandas 2.0 will be that the current numeric indexes (Int64Index, Uint64Index & Float64Index) will be removed and their functionality added to the base Index. In addition, the base index should be able to handle all numpy numeric dtypes (int8, int16 tc.), not just the current int64, uint64 & float64.
This PR makes progress towards that. In this PR I:
Index
with numpy numeric dtypes return aNumericIndex
with the given dtype rather thanconverting to the old 64 bit only numeric index types, making all numeric dtypes available for indexes.This is just the first part of the complete changes planned. In follow-ups PRs I will:
NumericIndex
into the baseIndex
and removeNumericIndex
Notable changes from this PR:
One notable change from the PR is that because we now have all the numeric dtypes available for indexes, indexes created from DateTimeIndex (day, year etc.) will now be in int32, where previously they were forced to int64 (because that was the only index integer dtype available).
Using int32 is the more correct way, because the underlying
DateTimeArray
returns 32bit arrays. An example of this:xref #42717, #41272