93
93
94
94
# see gh-16971
95
95
def remove_na (arr ):
96
- """
97
- DEPRECATED : this function will be removed in a future version.
96
+ """Remove null values from array like structure.
97
+
98
+ .. deprecated:: 0.21.0
99
+ Use s[s.notnull()] instead.
98
100
"""
99
101
100
102
warnings .warn ("remove_na is deprecated and is a private "
@@ -290,8 +292,10 @@ def _init_dict(self, data, index=None, dtype=None):
290
292
@classmethod
291
293
def from_array (cls , arr , index = None , name = None , dtype = None , copy = False ,
292
294
fastpath = False ):
293
- """
294
- DEPRECATED: use the pd.Series(..) constructor instead.
295
+ """Construct Series from array.
296
+
297
+ .. deprecated :: 0.23.0
298
+ Use pd.Series(..) constructor instead.
295
299
296
300
"""
297
301
warnings .warn ("'from_array' is deprecated and will be removed in a "
@@ -450,9 +454,11 @@ def get_values(self):
450
454
451
455
@property
452
456
def asobject (self ):
453
- """DEPRECATED: Use ``astype(object)`` instead.
457
+ """Return object Series which contains boxed values.
458
+
459
+ .. deprecated :: 0.23.0
460
+ Use ``astype(object) instead.
454
461
455
- return object Series which contains boxed values
456
462
457
463
*this is an internal non-public method*
458
464
"""
@@ -911,12 +917,10 @@ def repeat(self, repeats, *args, **kwargs):
911
917
index = new_index ).__finalize__ (self )
912
918
913
919
def get_value (self , label , takeable = False ):
914
- """
915
- Quickly retrieve single value at passed index label
920
+ """Quickly retrieve single value at passed index label
916
921
917
922
.. deprecated:: 0.21.0
918
-
919
- Please use .at[] or .iat[] accessors.
923
+ Please use .at[] or .iat[] accessors.
920
924
921
925
Parameters
922
926
----------
@@ -940,14 +944,12 @@ def _get_value(self, label, takeable=False):
940
944
_get_value .__doc__ = get_value .__doc__
941
945
942
946
def set_value (self , label , value , takeable = False ):
943
- """
944
- Quickly set single value at passed label. If label is not contained, a
945
- new object is created with the label placed at the end of the result
946
- index
947
+ """Quickly set single value at passed label. If label is not contained,
948
+ a new object is created with the label placed at the end of the result
949
+ index.
947
950
948
951
.. deprecated:: 0.21.0
949
-
950
- Please use .at[] or .iat[] accessors.
952
+ Please use .at[] or .iat[] accessors.
951
953
952
954
Parameters
953
955
----------
@@ -1382,13 +1384,13 @@ def idxmax(self, axis=None, skipna=True, *args, **kwargs):
1382
1384
return self .index [i ]
1383
1385
1384
1386
# ndarray compat
1385
- argmin = deprecate ('argmin' , idxmin ,
1387
+ argmin = deprecate ('argmin' , idxmin , '0.21.0' ,
1386
1388
msg = "'argmin' is deprecated, use 'idxmin' instead. "
1387
1389
"The behavior of 'argmin' will be corrected to "
1388
1390
"return the positional minimum in the future. "
1389
1391
"Use 'series.values.argmin' to get the position of "
1390
1392
"the minimum now." )
1391
- argmax = deprecate ('argmax' , idxmax ,
1393
+ argmax = deprecate ('argmax' , idxmax , '0.21.0' ,
1392
1394
msg = "'argmax' is deprecated, use 'idxmax' instead. "
1393
1395
"The behavior of 'argmax' will be corrected to "
1394
1396
"return the positional maximum in the future. "
@@ -2120,12 +2122,12 @@ def nsmallest(self, n=5, keep='first'):
2120
2122
return algorithms .SelectNSeries (self , n = n , keep = keep ).nsmallest ()
2121
2123
2122
2124
def sortlevel (self , level = 0 , ascending = True , sort_remaining = True ):
2123
- """
2124
- DEPRECATED: use :meth:`Series.sort_index`
2125
-
2126
- Sort Series with MultiIndex by chosen level. Data will be
2125
+ """Sort Series with MultiIndex by chosen level. Data will be
2127
2126
lexicographically sorted by the chosen level followed by the other
2128
- levels (in order)
2127
+ levels (in order),
2128
+
2129
+ .. deprecated:: 0.20.0
2130
+ Use :meth:`Series.sort_index`
2129
2131
2130
2132
Parameters
2131
2133
----------
@@ -2670,7 +2672,12 @@ def shift(self, periods=1, freq=None, axis=0):
2670
2672
return super (Series , self ).shift (periods = periods , freq = freq , axis = axis )
2671
2673
2672
2674
def reindex_axis (self , labels , axis = 0 , ** kwargs ):
2673
- """ for compatibility with higher dims """
2675
+ """Conform Series to new index with optional filling logic.
2676
+
2677
+ .. deprecated:: 0.21.0
2678
+ Use ``Series.reindex`` instead.
2679
+ """
2680
+ # for compatibility with higher dims
2674
2681
if axis != 0 :
2675
2682
raise ValueError ("cannot reindex series on non-zero axis!" )
2676
2683
msg = ("'.reindex_axis' is deprecated and will be removed in a future "
@@ -2808,9 +2815,10 @@ def between(self, left, right, inclusive=True):
2808
2815
@classmethod
2809
2816
def from_csv (cls , path , sep = ',' , parse_dates = True , header = None ,
2810
2817
index_col = 0 , encoding = None , infer_datetime_format = False ):
2811
- """
2812
- Read CSV file (DEPRECATED, please use :func:`pandas.read_csv`
2813
- instead).
2818
+ """Read CSV file.
2819
+
2820
+ .. deprecated:: 0.21.0
2821
+ Use :func:`pandas.read_csv` instead.
2814
2822
2815
2823
It is preferable to use the more powerful :func:`pandas.read_csv`
2816
2824
for most general purposes, but ``from_csv`` makes for an easy
@@ -2978,8 +2986,10 @@ def dropna(self, axis=0, inplace=False, **kwargs):
2978
2986
return self .copy ()
2979
2987
2980
2988
def valid (self , inplace = False , ** kwargs ):
2981
- """DEPRECATED. Series.valid will be removed in a future version.
2982
- Use :meth:`Series.dropna` instead.
2989
+ """Return Series without null values.
2990
+
2991
+ .. deprecated:: 0.23.0
2992
+ Use :meth:`Series.dropna` instead.
2983
2993
"""
2984
2994
warnings .warn ("Method .valid will be removed in a future version. "
2985
2995
"Use .dropna instead." , FutureWarning , stacklevel = 2 )
0 commit comments