Skip to content

Deprecate Series.ftype / DataFrame.ftypes #26705

Closed
@jorisvandenbossche

Description

@jorisvandenbossche

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions