'AttributeError: 'DataFrame' object has no attribute 'to_sparse'

sdf = df.to_sparse() has been deprecated. What's the updated version of this?



Solution 1:[1]

SparseSeries and SparseDataFrame were removed in 1.0.0 (see the release notes). As you can see in the migration guide there is no performance boost compared to a regular DataFrame or Series.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Lars