Skip to content

Commit 1249e84

Browse files
authored
DOC: Use top-level pd.IntervalArray in doc examples (#24475)
1 parent 4f1c1dc commit 1249e84

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

pandas/core/arrays/interval.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,8 @@
3030
_VALID_CLOSED = {'left', 'right', 'both', 'neither'}
3131
_interval_shared_docs = {}
3232

33-
# TODO(jschendel) remove constructor key when IntervalArray is public (GH22860)
3433
_shared_docs_kwargs = dict(
3534
klass='IntervalArray',
36-
constructor='pd.core.arrays.IntervalArray',
3735
name=''
3836
)
3937

@@ -105,7 +103,6 @@
105103
"""
106104

107105

108-
# TODO(jschendel) use a more direct call in Examples when made public (GH22860)
109106
@Appender(_interval_shared_docs['class'] % dict(
110107
klass="IntervalArray",
111108
summary="Pandas array for interval data that are closed on the same side.",
@@ -119,7 +116,7 @@
119116
A new ``IntervalArray`` can be constructed directly from an array-like of
120117
``Interval`` objects:
121118
122-
>>> pd.core.arrays.IntervalArray([pd.Interval(0, 1), pd.Interval(1, 5)])
119+
>>> pd.IntervalArray([pd.Interval(0, 1), pd.Interval(1, 5)])
123120
IntervalArray([(0, 1], (1, 5]],
124121
closed='right',
125122
dtype='interval[int64]')
@@ -1035,7 +1032,7 @@ def repeat(self, repeats, axis=None):
10351032
10361033
Examples
10371034
--------
1038-
>>> intervals = %(constructor)s.from_tuples([(0, 1), (1, 3), (2, 4)])
1035+
>>> intervals = pd.%(klass)s.from_tuples([(0, 1), (1, 3), (2, 4)])
10391036
>>> intervals
10401037
%(klass)s([(0, 1], (1, 3], (2, 4]],
10411038
closed='right',

pandas/core/indexes/interval.py

-2
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,8 @@
3636
_VALID_CLOSED = {'left', 'right', 'both', 'neither'}
3737
_index_doc_kwargs = dict(ibase._index_doc_kwargs)
3838

39-
# TODO(jschendel) remove constructor key when IntervalArray is public (GH22860)
4039
_index_doc_kwargs.update(
4140
dict(klass='IntervalIndex',
42-
constructor='pd.IntervalIndex',
4341
target_klass='IntervalIndex or list of Intervals',
4442
name=textwrap.dedent("""\
4543
name : object, optional

0 commit comments

Comments
 (0)