Skip to content

Commit

Permalink
review edits
Browse files Browse the repository at this point in the history
  • Loading branch information
jschendel committed Jan 23, 2018
1 parent 943ed8f commit 213b8eb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions pandas/core/indexes/interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ class IntervalIndex(IntervalMixin, Index):
dtype : dtype or None, default None
If None, dtype will be inferred
..versionadded:: 0.23.0
Attributes
----------
left
Expand Down Expand Up @@ -430,6 +432,8 @@ def from_breaks(cls, breaks, closed='right', name=None, copy=False,
dtype : dtype or None, default None
If None, dtype will be inferred
..versionadded:: 0.23.0
Examples
--------
>>> pd.IntervalIndex.from_breaks([0, 1, 2, 3])
Expand Down Expand Up @@ -472,6 +476,8 @@ def from_arrays(cls, left, right, closed='right', name=None, copy=False,
dtype : dtype or None, default None
If None, dtype will be inferred
..versionadded:: 0.23.0
Examples
--------
>>> pd.IntervalIndex.from_arrays([0, 1, 2], [1, 2, 3])
Expand Down Expand Up @@ -513,6 +519,8 @@ def from_intervals(cls, data, closed=None, name=None, copy=False,
dtype : dtype or None, default None
If None, dtype will be inferred
..versionadded:: 0.23.0
Examples
--------
>>> pd.IntervalIndex.from_intervals([pd.Interval(0, 1),
Expand Down Expand Up @@ -562,6 +570,8 @@ def from_tuples(cls, data, closed='right', name=None, copy=False,
dtype : dtype or None, default None
If None, dtype will be inferred
..versionadded:: 0.23.0
Examples
--------
>>> pd.IntervalIndex.from_tuples([(0, 1), (1,2)])
Expand Down Expand Up @@ -598,10 +608,6 @@ def from_tuples(cls, data, closed='right', name=None, copy=False,
left.append(lhs)
right.append(rhs)

# TODO
# if we have nulls and we previous had *only*
# integer data, then we have changed the dtype

return cls.from_arrays(left, right, closed, name=name, copy=False,
dtype=dtype)

Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/indexes/interval/test_construction.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def name(request):
class Base(object):
"""
Common tests for all variations of IntervalIndex construction. Input data
to be supplied in breaks format, then converted by the superclass method
to be supplied in breaks format, then converted by the subclass method
get_kwargs_from_breaks to the expected format.
"""

Expand Down

0 comments on commit 213b8eb

Please sign in to comment.