@@ -3692,6 +3692,33 @@ def as_blocks(self, copy=True):
36923692 Convert the frame to a dict of dtype -> Constructor Types that each has
36933693 a homogeneous dtype.
36943694
3695+ .. deprecated:: 0.21.0
3696+
3697+ NOTE: the dtypes of the blocks WILL BE PRESERVED HERE (unlike in
3698+ as_matrix)
3699+
3700+ Parameters
3701+ ----------
3702+ copy : boolean, default True
3703+
3704+ .. versionadded: 0.16.1
3705+
3706+ Returns
3707+ -------
3708+ values : a dict of dtype -> Constructor Types
3709+ """
3710+ warnings .warn ("as_blocks is deprecated and will "
3711+ "be removed in a future version" ,
3712+ FutureWarning , stacklevel = 2 )
3713+ return self ._as_blocks (copy = copy )
3714+
3715+ def _as_blocks (self , copy = True ):
3716+ """
3717+ Convert the frame to a dict of dtype -> Constructor Types that each has
3718+ a homogeneous dtype.
3719+
3720+ Internal routine only
3721+
36953722 NOTE: the dtypes of the blocks WILL BE PRESERVED HERE (unlike in
36963723 as_matrix)
36973724
@@ -3722,7 +3749,11 @@ def as_blocks(self, copy=True):
37223749
37233750 @property
37243751 def blocks (self ):
3725- """Internal property, property synonym for as_blocks()"""
3752+ """
3753+ Internal property, property synonym for as_blocks()
3754+
3755+ .. deprecated:: 0.21.0
3756+ """
37263757 return self .as_blocks ()
37273758
37283759 @deprecate_kwarg (old_arg_name = 'raise_on_error' , new_arg_name = 'errors' ,
@@ -3931,13 +3962,12 @@ def convert_objects(self, convert_dates=True, convert_numeric=False,
39313962 -------
39323963 converted : same as input object
39333964 """
3934- from warnings import warn
39353965 msg = ("convert_objects is deprecated. To re-infer data dtypes for "
39363966 "object columns, use {klass}.infer_objects()\n For all "
39373967 "other conversions use the data-type specific converters "
39383968 "pd.to_datetime, pd.to_timedelta and pd.to_numeric."
39393969 ).format (klass = self .__class__ .__name__ )
3940- warn (msg , FutureWarning , stacklevel = 2 )
3970+ warnings . warn (msg , FutureWarning , stacklevel = 2 )
39413971
39423972 return self ._constructor (
39433973 self ._data .convert (convert_dates = convert_dates ,
@@ -4310,9 +4340,9 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
43104340 raise AssertionError ("'to_replace' must be 'None' if 'regex' is "
43114341 "not a bool" )
43124342 if axis is not None :
4313- from warnings import warn
4314- warn ( 'the "axis" argument is deprecated and will be removed in'
4315- 'v0.13; this argument has no effect' )
4343+ warnings . warn ( 'the "axis" argument is deprecated '
4344+ ' and will be removed in'
4345+ 'v0.13; this argument has no effect' )
43164346
43174347 self ._consolidate_inplace ()
43184348
0 commit comments