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
Closed

DEPR: deprecate get_ftype_counts #18243

jreback opened this issue Nov 12, 2017 · 3 comments

Comments

@jreback
Copy link
Contributor

@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.

@jorisvandenbossche
Copy link
Member

@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
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 ?

@jreback jreback mentioned this issue Nov 13, 2017
26 of 34 tasks complete
@grutts
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?

@GGordonGordon
Copy link
Contributor

@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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants