File tree 3 files changed +11
-2
lines changed
3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -744,6 +744,7 @@ Deprecations
744
744
745
745
- ``pandas.tseries.plotting.tsplot`` is deprecated. Use :func:`Series.plot` instead (:issue:`18627`)
746
746
- ``Index.summary()`` is deprecated and will be removed in a future version (:issue:`18217`)
747
+ - ``NDFrame.get_ftype_counts()`` is deprecated and will be removed in a future version (:issue:`18243`)
747
748
748
749
.. _whatsnew_0230.prior_deprecations:
749
750
Original file line number Diff line number Diff line change @@ -4726,6 +4726,8 @@ def get_ftype_counts(self):
4726
4726
"""
4727
4727
Return counts of unique ftypes in this object.
4728
4728
4729
+ .. deprecated:: 0.23.0
4730
+
4729
4731
This is useful for SparseDataFrame or for DataFrames containing
4730
4732
sparse arrays.
4731
4733
@@ -4756,6 +4758,10 @@ def get_ftype_counts(self):
4756
4758
object:dense 1
4757
4759
dtype: int64
4758
4760
"""
4761
+ warnings .warn ("get_ftype_counts is deprecated and will "
4762
+ "be removed in a future version" ,
4763
+ FutureWarning , stacklevel = 2 )
4764
+
4759
4765
from pandas import Series
4760
4766
return Series (self ._data .get_ftype_counts ())
4761
4767
Original file line number Diff line number Diff line change @@ -64,8 +64,10 @@ def test_dtype(self):
64
64
assert self .ts .ftypes == 'float64:dense'
65
65
tm .assert_series_equal (self .ts .get_dtype_counts (),
66
66
Series (1 , ['float64' ]))
67
- tm .assert_series_equal (self .ts .get_ftype_counts (),
68
- Series (1 , ['float64:dense' ]))
67
+ # GH18243 - Assert .get_ftype_counts is deprecated
68
+ with tm .assert_produces_warning (FutureWarning ):
69
+ tm .assert_series_equal (self .ts .get_ftype_counts (),
70
+ Series (1 , ['float64:dense' ]))
69
71
70
72
@pytest .mark .parametrize ("value" , [np .nan , np .inf ])
71
73
@pytest .mark .parametrize ("dtype" , [np .int32 , np .int64 ])
You can’t perform that action at this time.
0 commit comments