@@ -3692,14 +3692,34 @@ 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+
36953697 NOTE: the dtypes of the blocks WILL BE PRESERVED HERE (unlike in
36963698 as_matrix)
36973699
36983700 Parameters
36993701 ----------
37003702 copy : boolean, default True
37013703
3702- .. versionadded: 0.16.1
3704+ Returns
3705+ -------
3706+ values : a dict of dtype -> Constructor Types
3707+ """
3708+ warnings .warn ("as_blocks is deprecated and will "
3709+ "be removed in a future version" ,
3710+ FutureWarning , stacklevel = 2 )
3711+ return self ._as_blocks (copy = copy )
3712+
3713+ def _as_blocks (self , copy = True ):
3714+ """
3715+ Convert the frame to a dict of dtype -> Constructor Types that each has
3716+ a homogeneous dtype.
3717+
3718+ Internal routine only
3719+
3720+ Parameters
3721+ ----------
3722+ copy : boolean, default True
37033723
37043724 Returns
37053725 -------
@@ -3722,7 +3742,11 @@ def as_blocks(self, copy=True):
37223742
37233743 @property
37243744 def blocks (self ):
3725- """Internal property, property synonym for as_blocks()"""
3745+ """
3746+ Internal property, property synonym for as_blocks()
3747+
3748+ .. deprecated:: 0.21.0
3749+ """
37263750 return self .as_blocks ()
37273751
37283752 @deprecate_kwarg (old_arg_name = 'raise_on_error' , new_arg_name = 'errors' ,
@@ -3931,13 +3955,12 @@ def convert_objects(self, convert_dates=True, convert_numeric=False,
39313955 -------
39323956 converted : same as input object
39333957 """
3934- from warnings import warn
39353958 msg = ("convert_objects is deprecated. To re-infer data dtypes for "
39363959 "object columns, use {klass}.infer_objects()\n For all "
39373960 "other conversions use the data-type specific converters "
39383961 "pd.to_datetime, pd.to_timedelta and pd.to_numeric."
39393962 ).format (klass = self .__class__ .__name__ )
3940- warn (msg , FutureWarning , stacklevel = 2 )
3963+ warnings . warn (msg , FutureWarning , stacklevel = 2 )
39413964
39423965 return self ._constructor (
39433966 self ._data .convert (convert_dates = convert_dates ,
@@ -4310,9 +4333,9 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
43104333 raise AssertionError ("'to_replace' must be 'None' if 'regex' is "
43114334 "not a bool" )
43124335 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' )
4336+ warnings . warn ( 'the "axis" argument is deprecated '
4337+ ' and will be removed in'
4338+ 'v0.13; this argument has no effect' )
43164339
43174340 self ._consolidate_inplace ()
43184341
0 commit comments