Skip to content

DOC: update the pandas.IntervalIndex docstring #20188

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

Closed
Closed
Changes from all 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
30 changes: 17 additions & 13 deletions pandas/core/indexes/interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,20 +142,24 @@ class IntervalIndex(IntervalMixin, Index):

Parameters
----------
data : array-like (1-dimensional)
data : array-Like (1-dimensional)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

array-like is correct

Array-like containing Interval objects from which to build the
IntervalIndex
IntervalIndex.
closed : {'left', 'right', 'both', 'neither'}, default 'right'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you swap the order of 'left' and 'right' here (and on the line below), so the default value appears first. I think some of the other Interval related PRs from the sprint did the same thing, and it'd be nice to make this consistent.

Whether the intervals are closed on the left-side, right-side, both or
neither.
dtype : dtype or None, default None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

numpy dtype, optional

If None, dtype will be inferred.
copy : boolean, default False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

boolean -> bool

Copy the meta-data.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this refers to copying of the input data

name : object, optional
Name to be stored in the index.
copy : boolean, default False
Copy the meta-data
dtype : dtype or None, default None
If None, dtype will be inferred

..versionadded:: 0.23.0
fastpath : boolean, default False
Create IntervalIndex without verifying integrity.
verify_integrity : boolean, default True
Verify that the IntervalIndex is valid.
..versionadded:: 0.23.0.

Attributes
----------
Expand Down Expand Up @@ -198,11 +202,11 @@ class IntervalIndex(IntervalMixin, Index):

See Also
--------
Index : The base pandas Index type
Interval : A bounded slice-like interval; the elements of an IntervalIndex
interval_range : Function to create a fixed frequency IntervalIndex
cut, qcut : Convert arrays of continuous data into Categoricals/Series of
Intervals
Index : The base pandas Index type.
Interval : A bounded slice-like interval; the elements of an IntervalIndex.
qcut : Quantile-based discretization function.
cut : Return indices of half-open bins to which each value of x belongs.
interval_range : Function to create a fixed frequency IntervalIndex.
"""
_typ = 'intervalindex'
_comparables = ['name']
Expand Down