The default fill value for sparse operations has changed from 0.0 to NaN in Pandas 3.0. This can affect downstream functions like the call to scikit-bio's multi_replace (which can't have NaNs in the input) in notebook 5 from the tutorials.
Specifically this line:
abundance_data = subset.to_dataframe().T
will now create a dataframe full of mostly NaNs.
There is already a simple solution, which is to just use the dense=True setting:
abundance_data = subset.to_dataframe(dense=True).T
@wasade Not sure if you want to change anything here in terms of the output of to_dataframe(dense=False), but I at least wanted to bring it to your attention. I'm gonna update the tutorial to use the dense=True option.
The default fill value for sparse operations has changed from
0.0toNaNin Pandas 3.0. This can affect downstream functions like the call to scikit-bio'smulti_replace(which can't have NaNs in the input) in notebook 5 from the tutorials.Specifically this line:
will now create a dataframe full of mostly NaNs.
There is already a simple solution, which is to just use the
dense=Truesetting:@wasade Not sure if you want to change anything here in terms of the output of
to_dataframe(dense=False), but I at least wanted to bring it to your attention. I'm gonna update the tutorial to use thedense=Trueoption.