File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -744,6 +744,7 @@ Deprecations
744744
745745- ``pandas.tseries.plotting.tsplot`` is deprecated. Use :func:`Series.plot` instead (:issue:`18627`)
746746- ``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`)
747748
748749.. _whatsnew_0230.prior_deprecations:
749750
Original file line number Diff line number Diff line change @@ -4726,6 +4726,8 @@ def get_ftype_counts(self):
47264726 """
47274727 Return counts of unique ftypes in this object.
47284728
4729+ .. deprecated:: 0.23.0
4730+
47294731 This is useful for SparseDataFrame or for DataFrames containing
47304732 sparse arrays.
47314733
@@ -4756,6 +4758,10 @@ def get_ftype_counts(self):
47564758 object:dense 1
47574759 dtype: int64
47584760 """
4761+ warnings .warn ("get_ftype_counts is deprecated and will "
4762+ "be removed in a future version" ,
4763+ FutureWarning , stacklevel = 2 )
4764+
47594765 from pandas import Series
47604766 return Series (self ._data .get_ftype_counts ())
47614767
Original file line number Diff line number Diff line change @@ -64,8 +64,10 @@ def test_dtype(self):
6464 assert self .ts .ftypes == 'float64:dense'
6565 tm .assert_series_equal (self .ts .get_dtype_counts (),
6666 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' ]))
6971
7072 @pytest .mark .parametrize ("value" , [np .nan , np .inf ])
7173 @pytest .mark .parametrize ("dtype" , [np .int32 , np .int64 ])
You can’t perform that action at this time.
0 commit comments