From ef2f4c2b7bec109428e1caaec1b4eeccdea776f7 Mon Sep 17 00:00:00 2001 From: Mortada Mehyar Date: Fri, 1 Jan 2016 18:07:03 -0800 Subject: [PATCH] DOC: several minor doc improvements --- doc/source/indexing.rst | 4 ++-- pandas/core/strings.py | 17 +++++++++-------- pandas/tools/merge.py | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/doc/source/indexing.rst b/doc/source/indexing.rst index 72f1e5749a886..6fa58bf620005 100644 --- a/doc/source/indexing.rst +++ b/doc/source/indexing.rst @@ -186,7 +186,7 @@ Attribute Access .. _indexing.attribute_access: -You may access an index on a ``Series``, column on a ``DataFrame``, and a item on a ``Panel`` directly +You may access an index on a ``Series``, column on a ``DataFrame``, and an item on a ``Panel`` directly as an attribute: .. ipython:: python @@ -1513,7 +1513,7 @@ Compare these two access methods: These both yield the same results, so which should you use? It is instructive to understand the order of operations on these and why method 2 (``.loc``) is much preferred over method 1 (chained ``[]``) -``dfmi['one']`` selects the first level of the columns and returns a data frame that is singly-indexed. +``dfmi['one']`` selects the first level of the columns and returns a DataFrame that is singly-indexed. Then another python operation ``dfmi_with_one['second']`` selects the series indexed by ``'second'`` happens. This is indicated by the variable ``dfmi_with_one`` because pandas sees these operations as separate events. e.g. separate calls to ``__getitem__``, so it has to treat them as linear operations, they happen one after another. diff --git a/pandas/core/strings.py b/pandas/core/strings.py index a8907ac192707..37c8e8b1d8829 100644 --- a/pandas/core/strings.py +++ b/pandas/core/strings.py @@ -967,13 +967,14 @@ def str_get(arr, i): def str_decode(arr, encoding, errors="strict"): """ - Decode character string in the Series/Index to unicode - using indicated encoding. Equivalent to :meth:`str.decode`. + Decode character string in the Series/Index using indicated encoding. + Equivalent to :meth:`str.decode` in python2 and :meth:`bytes.decode` in + python3. Parameters ---------- - encoding : string - errors : string + encoding : str + errors : str, optional Returns ------- @@ -985,13 +986,13 @@ def str_decode(arr, encoding, errors="strict"): def str_encode(arr, encoding, errors="strict"): """ - Encode character string in the Series/Index to some other encoding - using indicated encoding. Equivalent to :meth:`str.encode`. + Encode character string in the Series/Index using indicated encoding. + Equivalent to :meth:`str.encode`. Parameters ---------- - encoding : string - errors : string + encoding : str + errors : str, optional Returns ------- diff --git a/pandas/tools/merge.py b/pandas/tools/merge.py index 9399f537191e7..9211ffb5cfde5 100644 --- a/pandas/tools/merge.py +++ b/pandas/tools/merge.py @@ -792,7 +792,7 @@ def concat(objs, axis=0, join='outer', join_axes=None, ignore_index=False, If True, do not use the index values along the concatenation axis. The resulting axis will be labeled 0, ..., n - 1. This is useful if you are concatenating objects where the concatenation axis does not have - meaningful indexing information. Note the the index values on the other + meaningful indexing information. Note the index values on the other axes are still respected in the join. copy : boolean, default True If False, do not copy data unnecessarily