@@ -96,7 +96,7 @@ of multi-axis indexing.
96
96
97
97
.. versionadded :: 0.18.1
98
98
99
- See more at :ref: `Selection by Position <indexing.integer >`,
99
+ See more at :ref: `Selection by Position <indexing.integer >`,
100
100
:ref: `Advanced Indexing <advanced >` and :ref: `Advanced
101
101
Hierarchical <advanced.advanced_hierarchical>`.
102
102
@@ -125,7 +125,7 @@ Basics
125
125
As mentioned when introducing the data structures in the :ref: `last section
126
126
<basics>`, the primary function of indexing with ``[] `` (a.k.a. ``__getitem__ ``
127
127
for those familiar with implementing class behavior in Python) is selecting out
128
- lower-dimensional slices. The following table shows return type values when
128
+ lower-dimensional slices. The following table shows return type values when
129
129
indexing pandas objects with ``[] ``:
130
130
131
131
.. csv-table ::
@@ -235,7 +235,7 @@ as an attribute:
235
235
- The attribute will not be available if it conflicts with an existing method name, e.g. ``s.min `` is not allowed.
236
236
237
237
- Similarly, the attribute will not be available if it conflicts with any of the following list: ``index ``,
238
- ``major_axis ``, ``minor_axis ``, ``items ``, `` labels `` .
238
+ ``major_axis ``, ``minor_axis ``, ``items ``.
239
239
240
240
- In any of these cases, standard indexing will still work, e.g. ``s['1'] ``, ``s['min'] ``, and ``s['index'] `` will
241
241
access the corresponding element or column.
@@ -888,10 +888,10 @@ Boolean indexing
888
888
.. _indexing.boolean :
889
889
890
890
Another common operation is the use of boolean vectors to filter the data.
891
- The operators are: ``| `` for ``or ``, ``& `` for ``and ``, and ``~ `` for ``not ``.
891
+ The operators are: ``| `` for ``or ``, ``& `` for ``and ``, and ``~ `` for ``not ``.
892
892
These **must ** be grouped by using parentheses, since by default Python will
893
- evaluate an expression such as ``df.A > 2 & df.B < 3 `` as
894
- ``df.A > (2 & df.B) < 3 ``, while the desired evaluation order is
893
+ evaluate an expression such as ``df.A > 2 & df.B < 3 `` as
894
+ ``df.A > (2 & df.B) < 3 ``, while the desired evaluation order is
895
895
``(df.A > 2) & (df.B < 3) ``.
896
896
897
897
Using a boolean vector to index a Series works exactly as in a NumPy ndarray:
@@ -944,8 +944,8 @@ and :ref:`Advanced Indexing <advanced>` you may select along more than one axis
944
944
Indexing with isin
945
945
------------------
946
946
947
- Consider the :meth: `~Series.isin ` method of ``Series ``, which returns a boolean
948
- vector that is true wherever the ``Series `` elements exist in the passed list.
947
+ Consider the :meth: `~Series.isin ` method of ``Series ``, which returns a boolean
948
+ vector that is true wherever the ``Series `` elements exist in the passed list.
949
949
This allows you to select rows where one or more columns have values you want:
950
950
951
951
.. ipython :: python
@@ -1666,7 +1666,7 @@ Set an index
1666
1666
1667
1667
.. _indexing.set_index :
1668
1668
1669
- DataFrame has a :meth: `~DataFrame.set_index ` method which takes a column name
1669
+ DataFrame has a :meth: `~DataFrame.set_index ` method which takes a column name
1670
1670
(for a regular ``Index ``) or a list of column names (for a ``MultiIndex ``).
1671
1671
To create a new, re-indexed DataFrame:
1672
1672
@@ -1707,9 +1707,9 @@ the index in-place (without creating a new object):
1707
1707
Reset the index
1708
1708
~~~~~~~~~~~~~~~
1709
1709
1710
- As a convenience, there is a new function on DataFrame called
1711
- :meth: `~DataFrame.reset_index ` which transfers the index values into the
1712
- DataFrame's columns and sets a simple integer index.
1710
+ As a convenience, there is a new function on DataFrame called
1711
+ :meth: `~DataFrame.reset_index ` which transfers the index values into the
1712
+ DataFrame's columns and sets a simple integer index.
1713
1713
This is the inverse operation of :meth: `~DataFrame.set_index `.
1714
1714
1715
1715
0 commit comments