With the removal of IntegerIndex, FloatIndex, etc., and now promoting its replacement NumericIndex, there are a couple of things to consider:

  1. I think that NumericIndex should appear in pandas.__init__.py like the other Index types so that pd.NumericIndex works.
  2. We should document it, since we refer to it in the documentation. It appears as a result in examples, and we refer to it, e.g. here:

https://pandas.pydata.org/docs/dev/reference/api/pandas.Index.html?highlight=numericindex

@topper-123 may be tracking this based on comments in #50908

Comment From: phofl

I might be mistaken here, but I think the goal is to remove NumericIndex as well and to include everything in Index

Comment From: Dr-Irv

I might be mistaken here, but I think the goal is to remove NumericIndex as well and to include everything in Index

OK. I'm just basing this on what our tests in pandas-stubs picked up when we run our tests with pytest against the nightly builds. Had to remove references that we had to IntegerIndex and changed them to NumericIndex. If we are getting rid of that too, then I'll make the change in the tests there when the nightly test fails.

Comment From: topper-123

Hi, yes, the goal is to remove NumericIndex and have the numpy dtypes that were previously utilized in NumericIndex, included directly in Index instead. I'm hoping to archieve it over this weekend, so I don't know if it will be more time efficient for you to wait doing the corrections now or maybe wait until NumericIndexhas been removed.

I have not given any attention so far to pandas-stubs in this process, sorry. I could check if my changes fit well into that package or will you take care of that?

Comment From: Dr-Irv

I have not given any attention so far to pandas-stubs in this process, sorry. I could check if my changes fit well into that package or will you take care of that?

We'll take care of that. Once you close this issue, I'll know you've made the changes and can modify the stubs and associated tests.

Comment From: topper-123

👍

Comment From: Dr-Irv

@topper-123 I know you have done the work to remove NumericIndex, but our 1.5.x docs here say that NumericIndex will remain for 2.0: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Int64Index.html

Deprecated since version 1.4.0: In pandas v2.0 Int64Index will be removed and NumericIndex used instead. Int64Index will remain fully functional for the duration of pandas 1.x.

Comment From: topper-123

Hi @Dr-Irv. The original plan was actually to add NumericIndex to the top level namespace, but that was changed later to have all the numeric index functionality merged into the base Index. So that doc string was wrong/should have been updated, when the plans changed...

The changes have been made now, and NumericIndex has been removed completely now from the code base.

Comment From: Dr-Irv

Hi @Dr-Irv. The original plan was actually to add NumericIndex to the top level namespace, but that was changed later to have all the numeric index functionality merged into the base Index. So that doc string was wrong/should have been updated, when the plans changed...

So the question is whether our failure to update that doc string means we are violating our own principles with respect to the deprecation policy.

Comment From: phofl

Since NumericIndex was never public I‘d say no.

Comment From: topper-123

Yeah, In the 1.4 whatsnew we said:

Int64Index, UInt64Index and Float64Index have been deprecated in favor of the base Index class and will be removed in Pandas 2.0 (GH43028).

and the deprecation message was:

>>> idx = pd.Int64Index([])
FutureWarning: pandas.Int64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead.

In any case, that doc string should have been updated as well...

Comment From: Dr-Irv

and the deprecation message was:

```

idx = pd.Int64Index([]) FutureWarning: pandas.Int64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead. ```

I think that gives us enough coverage in case someone complains...

Comment From: jorisvandenbossche

We can still update the docs for 1.5.x

Comment From: jorisvandenbossche

-> https://github.com/pandas-dev/pandas/pull/51238