Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEPR: deprecate get_ftype_counts #18243

jreback opened this issue Nov 12, 2017 · 3 comments

DEPR: deprecate get_ftype_counts #18243

jreback opened this issue Nov 12, 2017 · 3 comments


Copy link

@jreback jreback commented Nov 12, 2017

These are only to provide some inside into a sparse dtype. These should in theory be encoded in the dtypes (in pandas2), but in reality these are just cluttering the API and actually an implementation detail.

Copy link

@jorisvandenbossche jorisvandenbossche commented Nov 13, 2017

As context, you can put a sparse data in a normal dataframe:

In [10]: df = pd.DataFrame({'a': [1, 2, 3]})

In [11]: df['b'] = pd.SparseSeries([3, 4, 5])

In [12]: df
   a  b
0  1  3
1  2  4
2  3  5

In [13]: df.dtypes
a    int64
b    int64
dtype: object

In [14]: df.ftypes
a     int64:dense
b    int64:sparse
dtype: object

In [16]: df['b']
0    3
1    4
2    5
Name: b, dtype: int64
Block locations: array([0], dtype=int32)
Block lengths: array([3], dtype=int32)

The question is: what is the alternative to easily check if a certain column is sparse ?

@jreback jreback mentioned this issue Nov 13, 2017
26 of 34 tasks complete
Copy link

@grutts grutts commented Dec 21, 2017

Happy to add the deprecation warnings for the usage of these. Is there something in particular that they should be replaced with, or just removed in a future version? Also, presuming .ftype is to be left as is?

Copy link

@GGordonGordon GGordonGordon commented Mar 19, 2018

The pull request only deals with deprecating .get_ftype_counts() and doesn't touch .ftypes since there was still some uncertainty around its deprecation.

xref #18262

@jreback jreback changed the title DEPR: deprecate .ftypes, get_ftype_counts DEPR: deprecate get_ftype_counts Mar 19, 2018
@jreback jreback mentioned this issue Nov 21, 2019
242 of 242 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants