Skip to content

Deprecate Series.ftype / DataFrame.ftypes #26705

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

Closed
jorisvandenbossche opened this issue Jun 7, 2019 · 6 comments · Fixed by #26744
Closed

Deprecate Series.ftype / DataFrame.ftypes #26705

jorisvandenbossche opened this issue Jun 7, 2019 · 6 comments · Fixed by #26744
Labels
Deprecate Functionality to remove in pandas good first issue Sparse Sparse Data Type
Milestone

Comments

@jorisvandenbossche
Copy link
Member

jorisvandenbossche commented Jun 7, 2019

With the ftype(s) property, you could check if data was sparse:

In [26]: df = pd.DataFrame({'a': pd.SparseArray([1, np.nan, 1])})

In [27]: df
Out[27]: 
     a
0  1.0
1  NaN
2  1.0

In [28]: df.dtypes
Out[28]: 
a    Sparse[float64, nan]
dtype: object

In [29]: df.ftypes
Out[29]: 
a    float64:sparse
dtype: object

But now that the dtype itself is a EA SparseDtype, I don't think those ftype and ftypes attributes serve any good purpose. So let's deprecate them.

@jorisvandenbossche jorisvandenbossche added good first issue Deprecate Functionality to remove in pandas Sparse Sparse Data Type labels Jun 7, 2019
@jorisvandenbossche jorisvandenbossche added this to the 0.25.0 milestone Jun 7, 2019
@jreback
Copy link
Contributor

jreback commented Jun 7, 2019

this is on my let’s deprecate ticket

@jorisvandenbossche
Copy link
Member Author

Yes, but wanted to highlight it specifically given all the sparse deprecations we are doing for 0.25.0, and small separate issues are easier taken up by contributors.

@jreback
Copy link
Contributor

jreback commented Jun 7, 2019

totally fine pls link it though

@thiviyanT
Copy link
Contributor

Hi @jreback @jorisvandenbossche,

I was looking for a good first issue to contribute to this project and came across this thread. Would you guys like any help with this issue?

@simonjayhawkins
Copy link
Member

@ThiviyanThanapalasingam go for it!

@thiviyanT
Copy link
Contributor

Series.ftype, Series.ftypes and DataFrame.ftypes have been deprecated. I have also updated the docstrings for the sphinx documentation and updated the unit tests to test for deprecation warnings when these features are used. Check out pull request #26744. Please let me know know if I have overlooked anything. Any feedback would be appreciated :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas good first issue Sparse Sparse Data Type
Projects
None yet
4 participants