From 4e6b223c9bb905fad4d6780466b4f05f0f7fcbc2 Mon Sep 17 00:00:00 2001 From: "Martina G. Vilas" Date: Mon, 19 Aug 2019 15:28:18 +0200 Subject: [PATCH 01/14] Add punctuation to pandas.IndexSlice --- pandas/core/indexing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/indexing.py b/pandas/core/indexing.py index ea00737f776ee..9bdf312c917f0 100755 --- a/pandas/core/indexing.py +++ b/pandas/core/indexing.py @@ -49,7 +49,7 @@ def get_indexers_list(): # the public IndexSlicerMaker class _IndexSlice: """ - Create an object to more easily perform multi-index slicing + Create an object to more easily perform multi-index slicing. See Also -------- From ebdd03793178ef1da10e4bc99099df4131e5b6fe Mon Sep 17 00:00:00 2001 From: "Martina G. Vilas" Date: Mon, 19 Aug 2019 15:30:58 +0200 Subject: [PATCH 02/14] Add punctuation to pandas.MultiIndex.names --- pandas/core/indexes/multi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/indexes/multi.py b/pandas/core/indexes/multi.py index b614952ba1e04..43d892e97c3b6 100644 --- a/pandas/core/indexes/multi.py +++ b/pandas/core/indexes/multi.py @@ -1250,7 +1250,7 @@ def _set_names(self, names, level=None, validate=True): self.levels[l].rename(name, inplace=True) names = property( - fset=_set_names, fget=_get_names, doc="""\nNames of levels in MultiIndex\n""" + fset=_set_names, fget=_get_names, doc="""\nNames of levels in MultiIndex.\n""" ) @Appender(_index_shared_docs["_get_grouper_for_level"]) From 42466e3d75999c930e51983e7aa526e36274145e Mon Sep 17 00:00:00 2001 From: "Martina G. Vilas" Date: Mon, 19 Aug 2019 18:52:44 +0200 Subject: [PATCH 03/14] Add punctuation to pandas.MultiIndex.is_lexsorted --- pandas/core/indexes/multi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/indexes/multi.py b/pandas/core/indexes/multi.py index 43d892e97c3b6..c9d2f6366ae1d 100644 --- a/pandas/core/indexes/multi.py +++ b/pandas/core/indexes/multi.py @@ -1762,7 +1762,7 @@ def is_all_dates(self): def is_lexsorted(self): """ - Return True if the codes are lexicographically sorted + Return True if the codes are lexicographically sorted. Returns ------- From a8c994c1c5a4a3bd6dde1c89892ca033473d71f2 Mon Sep 17 00:00:00 2001 From: "Martina G. Vilas" Date: Mon, 19 Aug 2019 18:54:13 +0200 Subject: [PATCH 04/14] Add punctuaction to pandas.MultiIndex.reorder_levels --- pandas/core/indexes/multi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/indexes/multi.py b/pandas/core/indexes/multi.py index c9d2f6366ae1d..761862b9f30e9 100644 --- a/pandas/core/indexes/multi.py +++ b/pandas/core/indexes/multi.py @@ -2246,7 +2246,7 @@ def swaplevel(self, i=-2, j=-1): def reorder_levels(self, order): """ - Rearrange levels using input order. May not drop or duplicate levels + Rearrange levels using input order. May not drop or duplicate levels. Parameters ---------- From 0f4f388d5468fc6f9988b2daef40eb714808de96 Mon Sep 17 00:00:00 2001 From: "Martina G. Vilas" Date: Mon, 19 Aug 2019 18:55:45 +0200 Subject: [PATCH 05/14] Add punctuation to pandas.DatetimeIndex.snap --- pandas/core/indexes/datetimes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/indexes/datetimes.py b/pandas/core/indexes/datetimes.py index 51daad3b42649..ca7b01e6b874f 100644 --- a/pandas/core/indexes/datetimes.py +++ b/pandas/core/indexes/datetimes.py @@ -735,7 +735,7 @@ def to_series(self, keep_tz=None, index=None, name=None): def snap(self, freq="S"): """ - Snap time stamps to nearest occurring frequency + Snap time stamps to nearest occurring frequency. Returns ------- From 13c9408d687dfe0d28e0d9016e32a6d0ad3a78e7 Mon Sep 17 00:00:00 2001 From: "Martina G. Vilas" Date: Mon, 19 Aug 2019 18:58:42 +0200 Subject: [PATCH 06/14] Add punctuation to pandas.DatetimeIndex.to_perioddelta --- pandas/core/arrays/datetimes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/arrays/datetimes.py b/pandas/core/arrays/datetimes.py index 093334a815938..7bc51e39460cf 100644 --- a/pandas/core/arrays/datetimes.py +++ b/pandas/core/arrays/datetimes.py @@ -1283,7 +1283,7 @@ def to_perioddelta(self, freq): """ Calculate TimedeltaArray of difference between index values and index converted to PeriodArray at specified - freq. Used for vectorized offsets + freq. Used for vectorized offsets. Parameters ---------- From 1d182acfe822731a0a32c442c2e017541c4a0df2 Mon Sep 17 00:00:00 2001 From: "Martina G. Vilas" Date: Mon, 19 Aug 2019 19:00:33 +0200 Subject: [PATCH 07/14] Add punctuation to pandas.DatetimeIndex.to_pydatetime --- pandas/core/arrays/datetimes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/arrays/datetimes.py b/pandas/core/arrays/datetimes.py index 7bc51e39460cf..70df708d36b3b 100644 --- a/pandas/core/arrays/datetimes.py +++ b/pandas/core/arrays/datetimes.py @@ -1158,7 +1158,7 @@ def tz_localize(self, tz, ambiguous="raise", nonexistent="raise", errors=None): def to_pydatetime(self): """ Return Datetime Array/Index as object ndarray of datetime.datetime - objects + objects. Returns ------- From 18fc06d89451bd9174b1fc028494fe60f7129975 Mon Sep 17 00:00:00 2001 From: "Martina G. Vilas" Date: Mon, 19 Aug 2019 19:05:18 +0200 Subject: [PATCH 08/14] Add punctuation to pandas.DatetimeIndex.to_series --- pandas/core/indexes/datetimes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/indexes/datetimes.py b/pandas/core/indexes/datetimes.py index ca7b01e6b874f..5a3a133157523 100644 --- a/pandas/core/indexes/datetimes.py +++ b/pandas/core/indexes/datetimes.py @@ -661,7 +661,7 @@ def _get_time_micros(self): def to_series(self, keep_tz=None, 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 + useful with map for returning an indexer based on an index. Parameters ---------- From 8f6214e2710f751b881dcb8f9753f0fb4d29e49f Mon Sep 17 00:00:00 2001 From: "Martina G. Vilas" Date: Mon, 19 Aug 2019 19:06:31 +0200 Subject: [PATCH 09/14] Add punctuation to pandas.TimedeltaIndex --- pandas/core/indexes/timedeltas.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/indexes/timedeltas.py b/pandas/core/indexes/timedeltas.py index d06afa3daa792..965c57572c079 100644 --- a/pandas/core/indexes/timedeltas.py +++ b/pandas/core/indexes/timedeltas.py @@ -68,7 +68,7 @@ class TimedeltaIndex( ): """ Immutable ndarray of timedelta64 data, represented internally as int64, and - which can be boxed to timedelta objects + which can be boxed to timedelta objects. Parameters ---------- From e84b8bac098afd102f7e6e3a0876c766e1e61ffe Mon Sep 17 00:00:00 2001 From: "Martina G. Vilas" Date: Mon, 19 Aug 2019 19:10:00 +0200 Subject: [PATCH 10/14] Add punctuation to pandas.PeriodIndex.is_leap_year --- pandas/core/arrays/period.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/arrays/period.py b/pandas/core/arrays/period.py index 20ce11c70c344..f2d74794eadf5 100644 --- a/pandas/core/arrays/period.py +++ b/pandas/core/arrays/period.py @@ -426,7 +426,7 @@ def __array__(self, dtype=None): @property def is_leap_year(self): """ - Logical indicating if the date belongs to a leap year + Logical indicating if the date belongs to a leap year. """ return isleapyear_arr(np.asarray(self.year)) From e50b26e7819fdb4acdfcb83a248c05e66f8f4d24 Mon Sep 17 00:00:00 2001 From: "Martina G. Vilas" Date: Mon, 19 Aug 2019 19:11:11 +0200 Subject: [PATCH 11/14] Add punctuation to pandas.api.extensions.ExtensionArray._concat_same_type --- pandas/core/arrays/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/arrays/base.py b/pandas/core/arrays/base.py index 5c121172d0e4f..ac9c4ecc9a350 100644 --- a/pandas/core/arrays/base.py +++ b/pandas/core/arrays/base.py @@ -957,7 +957,7 @@ def _concat_same_type( cls, to_concat: Sequence[ABCExtensionArray] ) -> ABCExtensionArray: """ - Concatenate multiple array + Concatenate multiple array. Parameters ---------- From 94e64a80fb5863e1fc355a5442bf3e60fc667768 Mon Sep 17 00:00:00 2001 From: "Martina G. Vilas" Date: Mon, 19 Aug 2019 19:12:08 +0200 Subject: [PATCH 12/14] Add punctuation to pandas.api.extensions.ExtensionArray.dropna --- pandas/core/arrays/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/arrays/base.py b/pandas/core/arrays/base.py index ac9c4ecc9a350..0778b6726d104 100644 --- a/pandas/core/arrays/base.py +++ b/pandas/core/arrays/base.py @@ -514,7 +514,7 @@ def fillna(self, value=None, method=None, limit=None): def dropna(self): """ - Return ExtensionArray without NA values + Return ExtensionArray without NA values. Returns ------- From bc42c312aeecd2d0c95d5d7678b1bc59a0245474 Mon Sep 17 00:00:00 2001 From: "Martina G. Vilas" Date: Tue, 20 Aug 2019 10:24:53 +0200 Subject: [PATCH 13/14] Improve pandas.TimedeltaIndex docstring --- pandas/core/indexes/timedeltas.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pandas/core/indexes/timedeltas.py b/pandas/core/indexes/timedeltas.py index 965c57572c079..8cf14e2ca777e 100644 --- a/pandas/core/indexes/timedeltas.py +++ b/pandas/core/indexes/timedeltas.py @@ -73,15 +73,15 @@ class TimedeltaIndex( Parameters ---------- data : array-like (1-dimensional), optional - Optional timedelta-like data to construct index with + Optional timedelta-like data to construct index with. unit : unit of the arg (D,h,m,s,ms,us,ns) denote the unit, optional - which is an integer/float number - freq : string or pandas offset object, optional + Which is an integer/float number. + freq : str or pandas offset object, optional One of pandas date offset strings or corresponding objects. The string 'infer' can be passed in order to set the frequency of the index as the - inferred frequency upon creation + inferred frequency upon creation. copy : bool - Make a copy of input ndarray + Make a copy of input ndarray. start : starting value, timedelta-like, optional If data is None, start is used as the start point in generating regular timedelta data. @@ -90,24 +90,24 @@ class TimedeltaIndex( periods : int, optional, > 0 Number of periods to generate, if generating index. Takes precedence - over end argument + over end argument. .. deprecated:: 0.24.0 end : end time, timedelta-like, optional If periods is none, generated index will extend to first conforming - time on or just past end argument + time on or just past end argument. .. deprecated:: 0.24. 0 - closed : string or None, default None + closed : str or None, default None Make the interval closed with respect to the given frequency to - the 'left', 'right', or both sides (None) + the 'left', 'right', or both sides (None). .. deprecated:: 0.24. 0 name : object - Name to be stored in the index + Name to be stored in the index. Attributes ---------- From 6db7c1e2cb07af948fa9df79675a18f222b6f4e9 Mon Sep 17 00:00:00 2001 From: "Martina G. Vilas" Date: Tue, 20 Aug 2019 10:31:57 +0200 Subject: [PATCH 14/14] Improve doctring of pandas.DatetimeIndex.to_series --- pandas/core/indexes/datetimes.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pandas/core/indexes/datetimes.py b/pandas/core/indexes/datetimes.py index 5a3a133157523..272066d476ce3 100644 --- a/pandas/core/indexes/datetimes.py +++ b/pandas/core/indexes/datetimes.py @@ -687,10 +687,10 @@ def to_series(self, keep_tz=None, index=None, name=None): behaviour and silence the warning. index : Index, optional - index of resulting Series. If None, defaults to original index - name : string, optional - name of resulting Series. If None, defaults to name of 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. Returns -------