-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
Improve check for sparse dataframes #16845
Copy link
Copy link
Closed
Labels
Description
Originally posted by @jorisvandenbossche in #16728
To be safe, I would also add a check that all columns are indeed sparse (the .sparse accessor now raises if not all columns are sparse, but I am not sure this is necessarily guaranteed to stay that way).
The explicit check would be something like:
df.dtypes.apply(pd.api.types.is_sparse).all()
See also pandas-dev/pandas#26706
Reactions are currently unavailable