From a0b1ae358db667e27ab5897e64f6f22ba6346d94 Mon Sep 17 00:00:00 2001 From: hughkelley Date: Mon, 30 Sep 2019 15:22:59 +0100 Subject: [PATCH 1/7] fix doc string for ExtensionArray.fillna issue #28685 --- pandas/core/arrays/base.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pandas/core/arrays/base.py b/pandas/core/arrays/base.py index 0778b6726d104..41bacf049f528 100644 --- a/pandas/core/arrays/base.py +++ b/pandas/core/arrays/base.py @@ -36,7 +36,7 @@ class ExtensionArray: """ Abstract base class for custom 1-D array types. - pandas will recognize instances of this class as proper arrays + pandas will recognize instances of this claspandas.api.extensions.ExtensionArray.views as proper arrays with a custom type and will not attempt to coerce them to objects. They may be stored directly inside a :class:`DataFrame` or :class:`Series`. @@ -474,7 +474,7 @@ def fillna(self, value=None, method=None, limit=None): method : {'backfill', 'bfill', 'pad', 'ffill', None}, default None Method to use for filling holes in reindexed Series pad / ffill: propagate last valid observation forward to next valid - backfill / bfill: use NEXT valid observation to fill gap + backfill / bfill: use NEXT valid observation to fill gap. limit : int, default None If method is specified, this is the maximum number of consecutive NaN values to forward/backward fill. In other words, if there is @@ -485,7 +485,8 @@ def fillna(self, value=None, method=None, limit=None): Returns ------- - filled : ExtensionArray with NA/NaN filled + ExtensionArray + with NA/NaN filled """ value, method = validate_fillna_kwargs(value, method) From a0e50970bf18e1e162d320146b4664212394ccc8 Mon Sep 17 00:00:00 2001 From: hughkelley Date: Mon, 30 Sep 2019 15:24:50 +0100 Subject: [PATCH 2/7] fix doc string return value description for ExtensionArray.fillna issue #28685 --- 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 41bacf049f528..a6efa6e560691 100644 --- a/pandas/core/arrays/base.py +++ b/pandas/core/arrays/base.py @@ -486,7 +486,7 @@ def fillna(self, value=None, method=None, limit=None): Returns ------- ExtensionArray - with NA/NaN filled + With NA/NaN filled. """ value, method = validate_fillna_kwargs(value, method) From 8901b2053247d5d2d385708da11e36d1ea0de8aa Mon Sep 17 00:00:00 2001 From: hughkelley Date: Mon, 30 Sep 2019 15:30:12 +0100 Subject: [PATCH 3/7] fix doc string formatting errors for ExtensionArray.view issue #28685 --- pandas/core/arrays/base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandas/core/arrays/base.py b/pandas/core/arrays/base.py index a6efa6e560691..21e39e8afcf94 100644 --- a/pandas/core/arrays/base.py +++ b/pandas/core/arrays/base.py @@ -870,11 +870,12 @@ def view(self, dtype=None) -> Union[ABCExtensionArray, np.ndarray]: Parameters ---------- dtype : str, np.dtype, or ExtensionDtype, optional - Default None + Default None. Returns ------- ExtensionArray + The array calling .view. """ # NB: # - This must return a *new* object referencing the same data, not self. From 32f9a21f7638e980a2cb31cb08a047ecfa6bc042 Mon Sep 17 00:00:00 2001 From: hughkelley Date: Mon, 30 Sep 2019 15:32:30 +0100 Subject: [PATCH 4/7] fix doc string formatting errors for ExtensionArray.shift issue #28685 --- pandas/core/arrays/base.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pandas/core/arrays/base.py b/pandas/core/arrays/base.py index 21e39e8afcf94..f14ad42955fb7 100644 --- a/pandas/core/arrays/base.py +++ b/pandas/core/arrays/base.py @@ -540,13 +540,14 @@ def shift(self, periods: int = 1, fill_value: object = None) -> ABCExtensionArra fill_value : object, optional The scalar value to use for newly introduced missing values. - The default is ``self.dtype.na_value`` + The default is ``self.dtype.na_value``. .. versionadded:: 0.24.0 Returns ------- - shifted : ExtensionArray + ExtensionArray + Shifted. Notes ----- From c5e31fcf3e49466b5e4023b7dbcaa0554c8c625d Mon Sep 17 00:00:00 2001 From: hughkelley Date: Wed, 2 Oct 2019 15:57:36 +0100 Subject: [PATCH 5/7] fix typos and formatting of method and class --- pandas/core/arrays/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/arrays/base.py b/pandas/core/arrays/base.py index f14ad42955fb7..30ebcb28dfe50 100644 --- a/pandas/core/arrays/base.py +++ b/pandas/core/arrays/base.py @@ -36,7 +36,7 @@ class ExtensionArray: """ Abstract base class for custom 1-D array types. - pandas will recognize instances of this claspandas.api.extensions.ExtensionArray.views as proper arrays + pandas will recognize instances of this class as proper arrays with a custom type and will not attempt to coerce them to objects. They may be stored directly inside a :class:`DataFrame` or :class:`Series`. @@ -876,7 +876,7 @@ def view(self, dtype=None) -> Union[ABCExtensionArray, np.ndarray]: Returns ------- ExtensionArray - The array calling .view. + A view of the :class:`ExtensionArray` calling :meth:`view`. """ # NB: # - This must return a *new* object referencing the same data, not self. From de80ceba07bd0b0d065efc774943b9641083c6c0 Mon Sep 17 00:00:00 2001 From: hughkelley Date: Mon, 14 Oct 2019 21:07:56 +0100 Subject: [PATCH 6/7] remove calling... --- 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 45f0555bd6919..638eb34130d78 100644 --- a/pandas/core/arrays/base.py +++ b/pandas/core/arrays/base.py @@ -876,7 +876,7 @@ def view(self, dtype=None) -> Union[ABCExtensionArray, np.ndarray]: Returns ------- ExtensionArray - A view of the :class:`ExtensionArray` calling :meth:`view`. + A view of the :class:`ExtensionArray`. """ # NB: # - This must return a *new* object referencing the same data, not self. From 357c50f04ef5e4ead5d728de3fca82e14a0468bd Mon Sep 17 00:00:00 2001 From: hughkelley Date: Mon, 14 Oct 2019 22:05:20 +0100 Subject: [PATCH 7/7] indentation --- pandas/core/arrays/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/arrays/base.py b/pandas/core/arrays/base.py index 638eb34130d78..53755695c97e3 100644 --- a/pandas/core/arrays/base.py +++ b/pandas/core/arrays/base.py @@ -546,8 +546,8 @@ def shift(self, periods: int = 1, fill_value: object = None) -> ABCExtensionArra Returns ------- - ExtensionArray - Shifted. + ExtensionArray + Shifted. Notes -----