Closed Cortexan closed 11 months ago
Noticing now you've already made similar changes to all DataFrame.corr() and DataFrame.cov() instances... so it's the same root issue also for instances of DataFrame.mean() / DataFrame.groupby.mean().
Thank you! Indeed this needs to be updated as well. Please feel free to submit a PR if you'd like.
In the current version of pairwise.py, pandas.core.groupby.DataFrameGroupBy.mean is utilized with default parameters:
However, the default parameters of pandas.core.groupby.DataFrameGroupBy.mean have changed in Pandas >= 2.0.0, such that 'numeric_only' defaults to 'False' - see here.
If Pandas >= 2.0.0 is used, this results in dtype errors when applying pingouin.pairwise_test to pandas.DataFrames containing non-integer series.
This is solved by setting the 'numeric_only' parameter of pandas.core.groupby.DataFrameGroupBy.mean to 'True':
To reproduce the error, run the snippet below first with Pandas <= 1.5.3, then with Pandas >= 2.0.0: