From 29503b8e7751d11e95575a9f5651536d1e897de0 Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Thu, 18 Apr 2019 10:26:49 +0200 Subject: [PATCH 1/3] DOC: add deprecated to docstring of Series.data/itemsize/strides/flags/base --- pandas/core/base.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pandas/core/base.py b/pandas/core/base.py index 1d3eb880f32e3..bb31ed54c9993 100644 --- a/pandas/core/base.py +++ b/pandas/core/base.py @@ -702,7 +702,7 @@ def item(self): @property def data(self): """ - Return the data pointer of the underlying data. + DEPRECATED. Return the data pointer of the underlying data. """ warnings.warn("{obj}.data is deprecated and will be removed " "in a future version".format(obj=type(self).__name__), @@ -712,7 +712,8 @@ def data(self): @property def itemsize(self): """ - Return the size of the dtype of the item of the underlying data. + DEPRECATED. Return the size of the dtype of the item of the underlying + data. """ warnings.warn("{obj}.itemsize is deprecated and will be removed " "in a future version".format(obj=type(self).__name__), @@ -729,7 +730,7 @@ def nbytes(self): @property def strides(self): """ - Return the strides of the underlying data. + DEPRECATED. Return the strides of the underlying data. """ warnings.warn("{obj}.strides is deprecated and will be removed " "in a future version".format(obj=type(self).__name__), @@ -746,7 +747,7 @@ def size(self): @property def flags(self): """ - Return the ndarray.flags for the underlying data. + DEPRECATED. Return the ndarray.flags for the underlying data. """ warnings.warn("{obj}.flags is deprecated and will be removed " "in a future version".format(obj=type(self).__name__), @@ -756,7 +757,8 @@ def flags(self): @property def base(self): """ - Return the base object if the memory of the underlying data is shared. + DEPRECATED. Return the base object if the memory of the underlying data + is shared. """ warnings.warn("{obj}.base is deprecated and will be removed " "in a future version".format(obj=type(self).__name__), From 9f51d6c2740ed08c0776921be86819b5706b16de Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Thu, 18 Apr 2019 10:58:20 +0200 Subject: [PATCH 2/3] use directive --- pandas/core/base.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/pandas/core/base.py b/pandas/core/base.py index bb31ed54c9993..0b3d8b601864d 100644 --- a/pandas/core/base.py +++ b/pandas/core/base.py @@ -702,7 +702,9 @@ def item(self): @property def data(self): """ - DEPRECATED. Return the data pointer of the underlying data. + Return the data pointer of the underlying data. + + .. deprecated:: 0.23.0 """ warnings.warn("{obj}.data is deprecated and will be removed " "in a future version".format(obj=type(self).__name__), @@ -712,8 +714,9 @@ def data(self): @property def itemsize(self): """ - DEPRECATED. Return the size of the dtype of the item of the underlying - data. + Return the size of the dtype of the item of the underlying data. + + .. deprecated:: 0.23.0 """ warnings.warn("{obj}.itemsize is deprecated and will be removed " "in a future version".format(obj=type(self).__name__), @@ -730,7 +733,9 @@ def nbytes(self): @property def strides(self): """ - DEPRECATED. Return the strides of the underlying data. + Return the strides of the underlying data. + + .. deprecated:: 0.23.0 """ warnings.warn("{obj}.strides is deprecated and will be removed " "in a future version".format(obj=type(self).__name__), @@ -747,7 +752,9 @@ def size(self): @property def flags(self): """ - DEPRECATED. Return the ndarray.flags for the underlying data. + Return the ndarray.flags for the underlying data. + + .. deprecated:: 0.23.0 """ warnings.warn("{obj}.flags is deprecated and will be removed " "in a future version".format(obj=type(self).__name__), @@ -757,8 +764,9 @@ def flags(self): @property def base(self): """ - DEPRECATED. Return the base object if the memory of the underlying data - is shared. + Return the base object if the memory of the underlying data is shared. + + .. deprecated:: 0.23.0 """ warnings.warn("{obj}.base is deprecated and will be removed " "in a future version".format(obj=type(self).__name__), From d6decb8dc2c82b02272d2619ec600ab1dd7891fc Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Thu, 18 Apr 2019 15:11:43 +0200 Subject: [PATCH 3/3] fixup