Skip to content

Commit 46eee7b

Browse files
committed
Merge remote-tracking branch 'upstream/master' into series_set_index
2 parents 26353ed + 0473aab commit 46eee7b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+591
-628
lines changed

.coveragerc

-30
This file was deleted.

doc/source/advanced.rst

+27-26
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
MultiIndex / Advanced Indexing
1616
******************************
1717

18-
This section covers indexing with a ``MultiIndex`` and more advanced indexing features.
18+
This section covers indexing with a ``MultiIndex`` and :ref:`more advanced indexing features <indexing.index_types>`.
1919

2020
See the :ref:`Indexing and Selecting Data <indexing>` for general indexing documentation.
2121

@@ -51,13 +51,13 @@ See the :ref:`cookbook<cookbook.multi_index>` for some advanced strategies.
5151
Creating a MultiIndex (hierarchical index) object
5252
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5353

54-
The ``MultiIndex`` object is the hierarchical analogue of the standard
55-
``Index`` object which typically stores the axis labels in pandas objects. You
54+
The :class:`MultiIndex` object is the hierarchical analogue of the standard
55+
:class:`Index` object which typically stores the axis labels in pandas objects. You
5656
can think of ``MultiIndex`` as an array of tuples where each tuple is unique. A
5757
``MultiIndex`` can be created from a list of arrays (using
58-
``MultiIndex.from_arrays``), an array of tuples (using
59-
``MultiIndex.from_tuples``), or a crossed set of iterables (using
60-
``MultiIndex.from_product``). The ``Index`` constructor will attempt to return
58+
:meth:`MultiIndex.from_arrays`), an array of tuples (using
59+
:meth:`MultiIndex.from_tuples`), or a crossed set of iterables (using
60+
:meth:`MultiIndex.from_product`). The ``Index`` constructor will attempt to return
6161
a ``MultiIndex`` when it is passed a list of tuples. The following examples
6262
demonstrate different ways to initialize MultiIndexes.
6363

@@ -76,15 +76,15 @@ demonstrate different ways to initialize MultiIndexes.
7676
s
7777
7878
When you want every pairing of the elements in two iterables, it can be easier
79-
to use the ``MultiIndex.from_product`` function:
79+
to use the :meth:`MultiIndex.from_product` method:
8080

8181
.. ipython:: python
8282
8383
iterables = [['bar', 'baz', 'foo', 'qux'], ['one', 'two']]
8484
pd.MultiIndex.from_product(iterables, names=['first', 'second'])
8585
8686
As a convenience, you can pass a list of arrays directly into Series or
87-
DataFrame to construct a MultiIndex automatically:
87+
DataFrame to construct a ``MultiIndex`` automatically:
8888

8989
.. ipython:: python
9090
@@ -140,7 +140,7 @@ may wish to generate your own ``MultiIndex`` when preparing the data set.
140140
Reconstructing the level labels
141141
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
142142

143-
The method ``get_level_values`` will return a vector of the labels for each
143+
The method :meth:`~MultiIndex.get_level_values` will return a vector of the labels for each
144144
location at a particular level:
145145

146146
.. ipython:: python
@@ -183,7 +183,7 @@ For example:
183183
184184
This is done to avoid a recomputation of the levels in order to make slicing
185185
highly performant. If you want to see only the used levels, you can use the
186-
:func:`MultiIndex.get_level_values` method.
186+
:meth:`~MultiIndex.get_level_values` method.
187187

188188
.. ipython:: python
189189
@@ -193,7 +193,7 @@ highly performant. If you want to see only the used levels, you can use the
193193
df[['foo','qux']].columns.get_level_values(0)
194194
195195
To reconstruct the ``MultiIndex`` with only the used levels, the
196-
``remove_unused_levels`` method may be used.
196+
:meth:`~MultiIndex.remove_unused_levels` method may be used.
197197

198198
.. versionadded:: 0.20.0
199199

@@ -400,8 +400,8 @@ You can use a right-hand-side of an alignable object as well.
400400
Cross-section
401401
~~~~~~~~~~~~~
402402

403-
The ``xs`` method of ``DataFrame`` additionally takes a level argument to make
404-
selecting data at a particular level of a MultiIndex easier.
403+
The :meth:`~DataFrame.xs` method of ``DataFrame`` additionally takes a level argument to make
404+
selecting data at a particular level of a ``MultiIndex`` easier.
405405

406406
.. ipython:: python
407407
@@ -519,7 +519,7 @@ to be sorted. As with any index, you can use ``sort_index``.
519519
520520
.. _advanced.sortlevel_byname:
521521

522-
You may also pass a level name to ``sort_index`` if the MultiIndex levels
522+
You may also pass a level name to ``sort_index`` if the ``MultiIndex`` levels
523523
are named.
524524

525525
.. ipython:: python
@@ -566,7 +566,8 @@ Furthermore, if you try to index something that is not fully lexsorted, this can
566566
In [5]: dfm.loc[(0,'y'):(1, 'z')]
567567
UnsortedIndexError: 'Key length (2) was greater than MultiIndex lexsort depth (1)'
568568
569-
The ``is_lexsorted()`` method on an ``Index`` show if the index is sorted, and the ``lexsort_depth`` property returns the sort depth:
569+
The :meth:`~MultiIndex.is_lexsorted` method on a ``MultiIndex`` shows if the
570+
index is sorted, and the ``lexsort_depth`` property returns the sort depth:
570571

571572
.. ipython:: python
572573
@@ -591,8 +592,8 @@ Take Methods
591592

592593
.. _advanced.take:
593594

594-
Similar to NumPy ndarrays, pandas Index, Series, and DataFrame also provides
595-
the ``take`` method that retrieves elements along a given axis at the given
595+
Similar to NumPy ndarrays, pandas ``Index``, ``Series``, and ``DataFrame`` also provides
596+
the :meth:`~DataFrame.take` method that retrieves elements along a given axis at the given
596597
indices. The given indices must be either a list or an ndarray of integer
597598
index positions. ``take`` will also accept negative integers as relative positions to the end of the object.
598599

@@ -668,8 +669,8 @@ In the following sub-sections we will highlight some other index types.
668669
CategoricalIndex
669670
~~~~~~~~~~~~~~~~
670671

671-
``CategoricalIndex`` is a type of index that is useful for supporting
672-
indexing with duplicates. This is a container around a ``Categorical``
672+
:class:`CategoricalIndex` is a type of index that is useful for supporting
673+
indexing with duplicates. This is a container around a :class:`Categorical`
673674
and allows efficient indexing and storage of an index with a large number of duplicated elements.
674675

675676
.. ipython:: python
@@ -758,19 +759,19 @@ Int64Index and RangeIndex
758759
759760
Indexing on an integer-based Index with floats has been clarified in 0.18.0, for a summary of the changes, see :ref:`here <whatsnew_0180.float_indexers>`.
760761
761-
``Int64Index`` is a fundamental basic index in pandas.
762-
This is an Immutable array implementing an ordered, sliceable set.
762+
:class:`Int64Index` is a fundamental basic index in pandas.
763+
This is an immutable array implementing an ordered, sliceable set.
763764
Prior to 0.18.0, the ``Int64Index`` would provide the default index for all ``NDFrame`` objects.
764765
765-
``RangeIndex`` is a sub-class of ``Int64Index`` added in version 0.18.0, now providing the default index for all ``NDFrame`` objects.
766+
:class:`RangeIndex` is a sub-class of ``Int64Index`` added in version 0.18.0, now providing the default index for all ``NDFrame`` objects.
766767
``RangeIndex`` is an optimized version of ``Int64Index`` that can represent a monotonic ordered set. These are analogous to Python `range types <https://docs.python.org/3/library/stdtypes.html#typesseq-range>`__.
767768
768769
.. _indexing.float64index:
769770
770771
Float64Index
771772
~~~~~~~~~~~~
772773
773-
By default a ``Float64Index`` will be automatically created when passing floating, or mixed-integer-floating values in index creation.
774+
By default a :class:`Float64Index` will be automatically created when passing floating, or mixed-integer-floating values in index creation.
774775
This enables a pure label-based slicing paradigm that makes ``[],ix,loc`` for scalar indexing and slicing work exactly the
775776
same.
776777
@@ -875,9 +876,9 @@ IntervalIndex
875876
876877
.. versionadded:: 0.20.0
877878
878-
:class:`IntervalIndex` together with its own dtype, ``interval`` as well as the
879-
:class:`Interval` scalar type, allow first-class support in pandas for interval
880-
notation.
879+
:class:`IntervalIndex` together with its own dtype, :class:`~pandas.api.types.IntervalDtype`
880+
as well as the :class:`Interval` scalar type, allow first-class support in pandas
881+
for interval notation.
881882
882883
The ``IntervalIndex`` allows some unique indexing and is also used as a
883884
return type for the categories in :func:`cut` and :func:`qcut`.

doc/source/api.rst

+1
Original file line numberDiff line numberDiff line change
@@ -2559,6 +2559,7 @@ objects.
25592559
.. autosummary::
25602560
:toctree: generated/
25612561

2562+
api.extensions.register_extension_dtype
25622563
api.extensions.register_dataframe_accessor
25632564
api.extensions.register_series_accessor
25642565
api.extensions.register_index_accessor

0 commit comments

Comments
 (0)