cellarium-ai / cellarium-ml

Distributed single-cell data analysis.
BSD 3-Clause "New" or "Revised" License
22 stars 3 forks source link

Fix pandas groupby FutureWarning #229

Closed sjfleming closed 3 months ago

sjfleming commented 3 months ago

Closes #216

I have seen this warning before. pandas is going to change the default behavior of groupby. If you do not have all categories present in the grouping categorical (i.e. you have "unused" categories), then the new behavior will be to drop the unused categories. Here, I think you want to keep all the categories (which is the current behavior, observed=False). I suggest pinning to the current behavior, which will also silence this warning.