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

Closed
jreback opened this issue Nov 12, 2017 · 3 comments · Fixed by #20404
Closed

DEPR: deprecate get_ftype_counts #18243

jreback opened this issue Nov 12, 2017 · 3 comments · Fixed by #20404
Labels
API Design Deprecate Functionality to remove in pandas good first issue Sparse Sparse Data Type
Milestone

Comments

@jreback
Copy link
Contributor

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.

@jreback jreback added API Design Deprecate Functionality to remove in pandas Difficulty Novice Sparse Sparse Data Type labels Nov 12, 2017
@jreback jreback added this to the 0.22.0 milestone Nov 12, 2017
@jorisvandenbossche
Copy link
Member

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
Out[12]: 
   a  b
0  1  3
1  2  4
2  3  5

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

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

In [16]: df['b']
Out[16]: 
0    3
1    4
2    5
Name: b, dtype: int64
BlockIndex
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 ?

@grutts
Copy link

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?

@GGordonGordon
Copy link
Contributor

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Design Deprecate Functionality to remove in pandas good first issue Sparse Sparse Data Type
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants