DEPR: DataFrame.get_dtype_counts by mroeschke · Pull Request #27145 · pandas-dev/pandas (original) (raw)
Unfortunately, .dtype.value_counts()
isn't a perfect replacement for get_value_counts()
(IMO it's better), so the test replacements calls the internal representation:
In [2]: df = pd.DataFrame([[1, 1.5, pd.Timestamp.now(), True]])
In [3]: df
Out[3]:
0 1 2 3
0 1 1.5 2019-06-30 11:55:24.380126 True
In [7]: df.get_dtype_counts().index
Out[7]: Index(['float64', 'int64', 'datetime64[ns]', 'bool'], dtype='object')
In [8]: df.dtypes.value_counts().index
Out[8]: Index([datetime64[ns], bool, float64, int64], dtype='object')