Skip to content
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

API: Remove IntervalArray from top-level #24926

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions doc/source/api/arrays.rst
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,12 @@ Properties
Interval.overlaps
Interval.right

A collection of intervals may be stored in an :class:`IntervalArray`.
A collection of intervals may be stored in an :class:`arrays.IntervalArray`.

.. autosummary::
:toctree: generated/

IntervalArray
arrays.IntervalArray
IntervalDtype

.. _api.arrays.integer_na:
Expand Down
4 changes: 2 additions & 2 deletions doc/source/whatsnew/v0.24.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ from the ``Series``:
ser.array
pser.array

These return an instance of :class:`IntervalArray` or :class:`arrays.PeriodArray`,
These return an instance of :class:`arrays.IntervalArray` or :class:`arrays.PeriodArray`,
the new extension arrays that back interval and period data.

.. warning::
Expand Down Expand Up @@ -411,7 +411,7 @@ Other Enhancements
- :meth:`Categorical.from_codes` now can take a ``dtype`` parameter as an alternative to passing ``categories`` and ``ordered`` (:issue:`24398`).
- New attribute ``__git_version__`` will return git commit sha of current build (:issue:`21295`).
- Compatibility with Matplotlib 3.0 (:issue:`22790`).
- Added :meth:`Interval.overlaps`, :meth:`IntervalArray.overlaps`, and :meth:`IntervalIndex.overlaps` for determining overlaps between interval-like objects (:issue:`21998`)
- Added :meth:`Interval.overlaps`, :meth:`arrays.IntervalArray.overlaps`, and :meth:`IntervalIndex.overlaps` for determining overlaps between interval-like objects (:issue:`21998`)
- :func:`read_fwf` now accepts keyword ``infer_nrows`` (:issue:`15138`).
- :func:`~DataFrame.to_parquet` now supports writing a ``DataFrame`` as a directory of parquet files partitioned by a subset of the columns when ``engine = 'pyarrow'`` (:issue:`23283`)
- :meth:`Timestamp.tz_localize`, :meth:`DatetimeIndex.tz_localize`, and :meth:`Series.tz_localize` have gained the ``nonexistent`` argument for alternative handling of nonexistent times. See :ref:`timeseries.timezone_nonexistent` (:issue:`8917`, :issue:`24466`)
Expand Down
1 change: 0 additions & 1 deletion pandas/core/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import numpy as np

from pandas.core.arrays import IntervalArray
from pandas.core.arrays.integer import (
Int8Dtype,
Int16Dtype,
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/array_.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def array(data, # type: Sequence[object]
============================== =====================================
Scalar Type Array Type
============================== =====================================
:class:`pandas.Interval` :class:`pandas.IntervalArray`
:class:`pandas.Interval` :class:`pandas.arrays.IntervalArray`
:class:`pandas.Period` :class:`pandas.arrays.PeriodArray`
:class:`datetime.datetime` :class:`pandas.arrays.DatetimeArray`
:class:`datetime.timedelta` :class:`pandas.arrays.TimedeltaArray`
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
A new ``IntervalArray`` can be constructed directly from an array-like of
``Interval`` objects:

>>> pd.IntervalArray([pd.Interval(0, 1), pd.Interval(1, 5)])
>>> pandas.IntervalArray([pd.Interval(0, 1), pd.Interval(1, 5)])
TomAugspurger marked this conversation as resolved.
Show resolved Hide resolved
IntervalArray([(0, 1], (1, 5]],
closed='right',
dtype='interval[int64]')
Expand Down
1 change: 0 additions & 1 deletion pandas/tests/api/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class TestPDApi(Base):
'Series', 'SparseArray', 'SparseDataFrame', 'SparseDtype',
'SparseSeries', 'Timedelta',
'TimedeltaIndex', 'Timestamp', 'Interval', 'IntervalIndex',
'IntervalArray',
'CategoricalDtype', 'PeriodDtype', 'IntervalDtype',
'DatetimeTZDtype',
'Int8Dtype', 'Int16Dtype', 'Int32Dtype', 'Int64Dtype',
Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/arrays/test_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@

# Interval
([pd.Interval(1, 2), pd.Interval(3, 4)], 'interval',
pd.IntervalArray.from_tuples([(1, 2), (3, 4)])),
pd.arrays.IntervalArray.from_tuples([(1, 2), (3, 4)])),

# Sparse
([0, 1], 'Sparse[int64]', pd.SparseArray([0, 1], dtype='int64')),
Expand Down Expand Up @@ -129,7 +129,7 @@ def test_array_copy():

# interval
([pd.Interval(0, 1), pd.Interval(1, 2)],
pd.IntervalArray.from_breaks([0, 1, 2])),
pd.arrays.IntervalArray.from_breaks([0, 1, 2])),

# datetime
([pd.Timestamp('2000',), pd.Timestamp('2001')],
Expand Down