Skip to content

Commit

Permalink
better warning message
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisvandenbossche committed Apr 18, 2018
1 parent c3ac291 commit f10dd3f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
20 changes: 10 additions & 10 deletions pandas/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,16 +737,16 @@ def item(self):
@property
def data(self):
""" return the data pointer of the underlying data """
warnings.warn("Series/Index.data is deprecated and will be "
"removed in a future version",
warnings.warn("{obj}.data is deprecated and will be removed "
"in a future version".format(obj=type(self).__name__),
FutureWarning, stacklevel=2)
return self.values.data

@property
def itemsize(self):
""" return the size of the dtype of the item of the underlying data """
warnings.warn("Series/Index.itemsize is deprecated and will be "
"removed in a future version",
warnings.warn("{obj}.itemsize is deprecated and will be removed "
"in a future version".format(obj=type(self).__name__),
FutureWarning, stacklevel=2)
return self._ndarray_values.itemsize

Expand All @@ -758,8 +758,8 @@ def nbytes(self):
@property
def strides(self):
""" return the strides of the underlying data """
warnings.warn("Series/Index.strides is deprecated and will be "
"removed in a future version",
warnings.warn("{obj}.strudes is deprecated and will be removed "
"in a future version".format(obj=type(self).__name__),
FutureWarning, stacklevel=2)
return self._ndarray_values.strides

Expand All @@ -771,8 +771,8 @@ def size(self):
@property
def flags(self):
""" return the ndarray.flags for the underlying data """
warnings.warn("Series/Index.flags is deprecated and will be "
"removed in a future version",
warnings.warn("{obj}.flags is deprecated and will be removed "
"in a future version".format(obj=type(self).__name__),
FutureWarning, stacklevel=2)
return self.values.flags

Expand All @@ -781,8 +781,8 @@ def base(self):
""" return the base object if the memory of the underlying data is
shared
"""
warnings.warn("Series/Index.base is deprecated and will be "
"removed in a future version",
warnings.warn("{obj}.base is deprecated and will be removed "
"in a future version".format(obj=type(self).__name__),
FutureWarning, stacklevel=2)
return self.values.base

Expand Down
1 change: 0 additions & 1 deletion pandas/tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from pandas.core.base import PandasObject, NoNewAttributesMixin
from pandas.core.indexes.datetimelike import DatetimeIndexOpsMixin
from pandas._libs.tslib import iNaT
import pandas.util.testing as tm


class CheckStringMixin(object):
Expand Down

0 comments on commit f10dd3f

Please sign in to comment.