Skip to content

Commit 9b6c774

Browse files
committed
DOC/CLN: fixed bloolean indexing example, cleaned up typos
1 parent a63d36b commit 9b6c774

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

doc/source/indexing.rst

+10-9
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ The axis labeling information in pandas objects serves many purposes:
3030
In this section, we will focus on the final point: namely, how to slice, dice,
3131
and generally get and set subsets of pandas objects. The primary focus will be
3232
on Series and DataFrame as they have received more development attention in
33-
this area. Expect more work to be invested higher-dimensional data structures
34-
(including ``Panel``) in the future, especially in label-based advanced
35-
indexing.
33+
this area. Expect more work to be invested in higher-dimensional data
34+
structures (including ``Panel``) in the future, especially in label-based
35+
advanced indexing.
3636

3737
.. note::
3838

@@ -54,7 +54,7 @@ indexing.
5454

5555
.. warning::
5656

57-
In 0.15.0 ``Index`` has internally been refactored to no longer sub-class ``ndarray``
57+
In 0.15.0 ``Index`` has internally been refactored to no longer subclass ``ndarray``
5858
but instead subclass ``PandasObject``, similarly to the rest of the pandas objects. This should be
5959
a transparent change with only very limited API implications (See the :ref:`Internal Refactoring <whatsnew_0150.refactoring>`)
6060

@@ -225,9 +225,9 @@ new column.
225225
226226
sa.a = 5
227227
sa
228-
dfa.A = list(range(len(dfa.index))) # ok if A already exists
228+
dfa.A = list(range(len(dfa.index))) # ok if A already exists
229229
dfa
230-
dfa['A'] = list(range(len(dfa.index))) # use this form to create a new column
230+
dfa['A'] = list(range(len(dfa.index))) # use this form to create a new column
231231
dfa
232232
233233
.. warning::
@@ -314,7 +314,7 @@ Selection By Label
314314
dfl.loc['20130102':'20130104']
315315
316316
pandas provides a suite of methods in order to have **purely label based indexing**. This is a strict inclusion based protocol.
317-
**at least 1** of the labels for which you ask, must be in the index or a ``KeyError`` will be raised! When slicing, the start bound is *included*, **AND** the stop bound is *included*. Integers are valid labels, but they refer to the label **and not the position**.
317+
**At least 1** of the labels for which you ask, must be in the index or a ``KeyError`` will be raised! When slicing, the start bound is *included*, **AND** the stop bound is *included*. Integers are valid labels, but they refer to the label **and not the position**.
318318

319319
The ``.loc`` attribute is the primary access method. The following are valid inputs:
320320

@@ -578,9 +578,10 @@ Using a boolean vector to index a Series works exactly as in a numpy ndarray:
578578

579579
.. ipython:: python
580580
581+
s = Series(range(-3, 4))
582+
s
581583
s[s > 0]
582-
s[(s < 0) & (s > -0.5)]
583-
s[(s < -1) | (s > 1 )]
584+
s[(s < -1) | (s > 0.5)]
584585
s[~(s < 0)]
585586
586587
You may select rows from a DataFrame using a boolean vector the same length as

doc/source/options.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Overview
1818
pandas has an options system that lets you customize some aspects of its behaviour,
1919
display-related options being those the user is most likely to adjust.
2020

21-
Options have a full "dotted-style", case-insensitive name (e.g. ``display.max_rows``),
21+
Options have a full "dotted-style", case-insensitive name (e.g. ``display.max_rows``).
2222
You can get/set options directly as attributes of the top-level ``options`` attribute:
2323

2424
.. ipython:: python
@@ -29,7 +29,7 @@ You can get/set options directly as attributes of the top-level ``options`` attr
2929
pd.options.display.max_rows
3030
3131
There is also an API composed of 5 relevant functions, available directly from the ``pandas``
32-
namespace, and they are:
32+
namespace:
3333

3434
- :func:`~pandas.get_option` / :func:`~pandas.set_option` - get/set the value of a single option.
3535
- :func:`~pandas.reset_option` - reset one or more options to their default value.
@@ -412,7 +412,7 @@ mode.use_inf_as_null False True means treat None, NaN, -INF,
412412
Number Formatting
413413
------------------
414414

415-
pandas also allow you to set how numbers are displayed in the console.
415+
pandas also allows you to set how numbers are displayed in the console.
416416
This option is not set through the ``set_options`` API.
417417

418418
Use the ``set_eng_float_format`` function

0 commit comments

Comments
 (0)