Skip to content

Commit 2892b95

Browse files
jbrockmendeljorisvandenbossche
authored andcommitted
DEPR: pandas.core.index (#30193)
1 parent 3904942 commit 2892b95

File tree

33 files changed

+68
-46
lines changed

33 files changed

+68
-46
lines changed

doc/source/user_guide/io.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4683,6 +4683,7 @@ See the documentation for `pyarrow <https://arrow.apache.org/docs/python/>`__ an
46834683
Write to a parquet file.
46844684

46854685
.. ipython:: python
4686+
:okwarning:
46864687
46874688
df.to_parquet('example_pa.parquet', engine='pyarrow')
46884689
df.to_parquet('example_fp.parquet', engine='fastparquet')

doc/source/whatsnew/v1.0.0.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,8 @@ Optional libraries below the lowest tested version may still work, but are not c
433433
+-----------------+-----------------+---------+
434434
| pytables | 3.4.2 | |
435435
+-----------------+-----------------+---------+
436+
| s3fs | 0.3.0 | X |
437+
+-----------------+-----------------+---------+
436438
| scipy | 0.19.0 | |
437439
+-----------------+-----------------+---------+
438440
| sqlalchemy | 1.1.4 | |
@@ -454,7 +456,7 @@ See :ref:`install.dependencies` and :ref:`install.optional_dependencies` for mor
454456
Other API changes
455457
^^^^^^^^^^^^^^^^^
456458

457-
- Bumpded the minimum supported version of ``s3fs`` from 0.0.8 to 0.3.0 (:issue:`28616`)
459+
- Bumped the minimum supported version of ``s3fs`` from 0.0.8 to 0.3.0 (:issue:`28616`)
458460
- :class:`pandas.core.groupby.GroupBy.transform` now raises on invalid operation names (:issue:`27489`)
459461
- :meth:`pandas.api.types.infer_dtype` will now return "integer-na" for integer and ``np.nan`` mix (:issue:`27283`)
460462
- :meth:`MultiIndex.from_arrays` will no longer infer names from arrays if ``names=None`` is explicitly provided (:issue:`27292`)
@@ -492,6 +494,7 @@ Deprecations
492494
- :meth:`Categorical.take_nd` is deprecated, use :meth:`Categorical.take` instead (:issue:`27745`)
493495
- The parameter ``numeric_only`` of :meth:`Categorical.min` and :meth:`Categorical.max` is deprecated and replaced with ``skipna`` (:issue:`25303`)
494496
- The parameter ``label`` in :func:`lreshape` has been deprecated and will be removed in a future version (:issue:`29742`)
497+
- ``pandas.core.index`` has been deprecated and will be removed in a future version, the public classes are available in the top-level namespace (:issue:`19711`)
495498
-
496499

497500
.. _whatsnew_1000.prior_deprecations:

pandas/_libs/internals.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ cdef class BlockPlacement:
9696
return self._as_array
9797

9898
def isin(self, arr):
99-
from pandas.core.index import Int64Index
99+
from pandas.core.indexes.api import Int64Index
100100
return Int64Index(self.as_array, copy=False).isin(arr)
101101

102102
@property

pandas/_libs/lib.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ def astype_str(arr: ndarray, skipna: bool=False) -> ndarray[object]:
598598
@cython.boundscheck(False)
599599
def clean_index_list(obj: list):
600600
"""
601-
Utility used in ``pandas.core.index.ensure_index``.
601+
Utility used in ``pandas.core.indexes.api.ensure_index``.
602602
"""
603603
cdef:
604604
Py_ssize_t i, n = len(obj)

pandas/core/api.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
import numpy as np
44

5+
from pandas._libs import NaT, Period, Timedelta, Timestamp
6+
from pandas._libs.missing import NA
7+
58
from pandas.core.dtypes.dtypes import (
69
CategoricalDtype,
710
DatetimeTZDtype,
@@ -26,24 +29,23 @@
2629
from pandas.core.arrays.string_ import StringDtype
2730
from pandas.core.construction import array
2831
from pandas.core.groupby import Grouper, NamedAgg
29-
from pandas.core.index import (
32+
from pandas.core.indexes.api import (
3033
CategoricalIndex,
3134
DatetimeIndex,
3235
Float64Index,
3336
Index,
3437
Int64Index,
3538
IntervalIndex,
3639
MultiIndex,
37-
NaT,
3840
PeriodIndex,
3941
RangeIndex,
4042
TimedeltaIndex,
4143
UInt64Index,
4244
)
43-
from pandas.core.indexes.datetimes import Timestamp, bdate_range, date_range
45+
from pandas.core.indexes.datetimes import bdate_range, date_range
4446
from pandas.core.indexes.interval import Interval, interval_range
45-
from pandas.core.indexes.period import Period, period_range
46-
from pandas.core.indexes.timedeltas import Timedelta, timedelta_range
47+
from pandas.core.indexes.period import period_range
48+
from pandas.core.indexes.timedeltas import timedelta_range
4749
from pandas.core.indexing import IndexSlice
4850
from pandas.core.series import Series
4951
from pandas.core.tools.datetimes import to_datetime
@@ -55,5 +57,3 @@
5557

5658
# DataFrame needs to be imported after NamedAgg to avoid a circular import
5759
from pandas.core.frame import DataFrame # isort:skip
58-
59-
from pandas._libs.missing import NA

pandas/core/arrays/sparse/scipy_sparse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"""
66
from collections import OrderedDict
77

8-
from pandas.core.index import Index, MultiIndex
8+
from pandas.core.indexes.api import Index, MultiIndex
99
from pandas.core.series import Series
1010

1111

pandas/core/construction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050
if TYPE_CHECKING:
5151
from pandas.core.series import Series # noqa: F401
52-
from pandas.core.index import Index # noqa: F401
52+
from pandas.core.indexes.api import Index # noqa: F401
5353

5454

5555
def array(

pandas/core/frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@
9393
from pandas.core.arrays.datetimelike import DatetimeLikeArrayMixin as DatetimeLikeArray
9494
from pandas.core.arrays.sparse import SparseFrameAccessor
9595
from pandas.core.generic import NDFrame, _shared_docs
96-
from pandas.core.index import Index, ensure_index, ensure_index_from_sequences
9796
from pandas.core.indexes import base as ibase
97+
from pandas.core.indexes.api import Index, ensure_index, ensure_index_from_sequences
9898
from pandas.core.indexes.datetimes import DatetimeIndex
9999
from pandas.core.indexes.multi import maybe_droplevels
100100
from pandas.core.indexes.period import PeriodIndex

pandas/core/generic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
from pandas.core.base import PandasObject, SelectionMixin
7474
import pandas.core.common as com
7575
from pandas.core.construction import create_series_with_explicit_dtype
76-
from pandas.core.index import (
76+
from pandas.core.indexes.api import (
7777
Index,
7878
InvalidIndexError,
7979
MultiIndex,

pandas/core/groupby/groupby.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class providing the base-class of operations.
5959
from pandas.core.frame import DataFrame
6060
from pandas.core.generic import NDFrame
6161
from pandas.core.groupby import base, ops
62-
from pandas.core.index import CategoricalIndex, Index, MultiIndex
62+
from pandas.core.indexes.api import CategoricalIndex, Index, MultiIndex
6363
from pandas.core.series import Series
6464
from pandas.core.sorting import get_group_index_sorter
6565

0 commit comments

Comments
 (0)