From 67fba5d7f9e2cd6b2c0989ddda1453846d3f1ae9 Mon Sep 17 00:00:00 2001 From: hughkelley Date: Mon, 28 Oct 2019 19:35:49 +0000 Subject: [PATCH 1/3] formatting of .to_series docstring --- pandas/core/indexes/base.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index 4c15e4b26ed46..b4c8419b2b063 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -1169,20 +1169,22 @@ def to_flat_index(self): def to_series(self, index=None, name=None): """ - Create a Series with both index and values equal to the index keys - useful with map for returning an indexer based on an index. + Create a Series with both index and values equal to the index keys. + + Useful with map for returning an indexer based on an index. Parameters ---------- index : Index, optional - index of resulting Series. If None, defaults to original index + Index of resulting Series. If None, defaults to original index. name : str, optional - name of resulting Series. If None, defaults to name of original - index + Dame of resulting Series. If None, defaults to name of original + index. Returns ------- - Series : dtype will be based on the type of the Index values. + Series + The dtype will be based on the type of the Index values. """ from pandas import Series From 8930200359973e2752d46b82da563294a0b270c2 Mon Sep 17 00:00:00 2001 From: hughkelley Date: Mon, 28 Oct 2019 20:04:38 +0000 Subject: [PATCH 2/3] formatting TimedeltaIndex.mean --- pandas/core/arrays/datetimelike.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pandas/core/arrays/datetimelike.py b/pandas/core/arrays/datetimelike.py index 84a4cbbc0a447..7bd2a417e70ba 100644 --- a/pandas/core/arrays/datetimelike.py +++ b/pandas/core/arrays/datetimelike.py @@ -1457,15 +1457,16 @@ def mean(self, skipna=True): Parameters ---------- skipna : bool, default True - Whether to ignore any NaT elements + Whether to ignore any NaT elements. Returns ------- - scalar (Timestamp or Timedelta) + scalar + Timestamp or Timedelta. See Also -------- - numpy.ndarray.mean + numpy.ndarray.mean : Returns the average of the array elements along a given axis. Series.mean : Return the mean value in a Series. Notes From 4e2d625b61b503098a3d443b58d0a3d8d58fc452 Mon Sep 17 00:00:00 2001 From: hughkelley Date: Mon, 28 Oct 2019 22:17:28 +0000 Subject: [PATCH 3/3] pep8 --- pandas/core/arrays/datetimelike.py | 2 +- pandas/core/indexes/base.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/arrays/datetimelike.py b/pandas/core/arrays/datetimelike.py index 7bd2a417e70ba..7a6f28a86dee0 100644 --- a/pandas/core/arrays/datetimelike.py +++ b/pandas/core/arrays/datetimelike.py @@ -1466,7 +1466,7 @@ def mean(self, skipna=True): See Also -------- - numpy.ndarray.mean : Returns the average of the array elements along a given axis. + numpy.ndarray.mean : Returns the average of array elements along a given axis. Series.mean : Return the mean value in a Series. Notes diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index b4c8419b2b063..79d97a13e37ca 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -1170,7 +1170,7 @@ def to_flat_index(self): def to_series(self, index=None, name=None): """ Create a Series with both index and values equal to the index keys. - + Useful with map for returning an indexer based on an index. Parameters