Skip to content

DOC/CLN: fixed bloolean indexing example, cleaned up typos #9866

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

Merged
merged 1 commit into from
Apr 13, 2015
Merged
Show file tree
Hide file tree
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
19 changes: 10 additions & 9 deletions doc/source/indexing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ The axis labeling information in pandas objects serves many purposes:
In this section, we will focus on the final point: namely, how to slice, dice,
and generally get and set subsets of pandas objects. The primary focus will be
on Series and DataFrame as they have received more development attention in
this area. Expect more work to be invested higher-dimensional data structures
(including ``Panel``) in the future, especially in label-based advanced
indexing.
this area. Expect more work to be invested in higher-dimensional data
structures (including ``Panel``) in the future, especially in label-based
advanced indexing.

.. note::

Expand All @@ -54,7 +54,7 @@ indexing.

.. warning::

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

Expand Down Expand Up @@ -225,9 +225,9 @@ new column.

sa.a = 5
sa
dfa.A = list(range(len(dfa.index))) # ok if A already exists
dfa.A = list(range(len(dfa.index))) # ok if A already exists
dfa
dfa['A'] = list(range(len(dfa.index))) # use this form to create a new column
dfa['A'] = list(range(len(dfa.index))) # use this form to create a new column
dfa

.. warning::
Expand Down Expand Up @@ -314,7 +314,7 @@ Selection By Label
dfl.loc['20130102':'20130104']

pandas provides a suite of methods in order to have **purely label based indexing**. This is a strict inclusion based protocol.
**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**.
**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**.

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

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

.. ipython:: python

s = Series(range(-3, 4))
s
s[s > 0]
s[(s < 0) & (s > -0.5)]
s[(s < -1) | (s > 1 )]
s[(s < -1) | (s > 0.5)]
s[~(s < 0)]

You may select rows from a DataFrame using a boolean vector the same length as
Expand Down
6 changes: 3 additions & 3 deletions doc/source/options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Overview
pandas has an options system that lets you customize some aspects of its behaviour,
display-related options being those the user is most likely to adjust.

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

.. ipython:: python
Expand All @@ -29,7 +29,7 @@ You can get/set options directly as attributes of the top-level ``options`` attr
pd.options.display.max_rows

There is also an API composed of 5 relevant functions, available directly from the ``pandas``
namespace, and they are:
namespace:

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

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

Use the ``set_eng_float_format`` function
Expand Down