gh-19889 reported that the output dtype of scipy.stats.rankdata depended not only on the method argument but also the presence of NaNs in the input array. PR gh-19890 proposed to always return a floating point array, but got stuck while discussing mitigation of backward compatibility concerns (e.g. FutureWarning, adding dtype keyword argument).
Recent discussions in gh-24411 and jax-ml/jax#34490 have revived the issue. The discussion has settled on simply changing the dtype effective SciPy 1.18.0 and documenting the backward incompatible change in the release notes. The solution for affected users is simple: cast the output to an integer type if needed.
gh-24420 would implement the change. It simplifies several SciPy functions, which previously needed to manually convert the output of rankdata to propagate the original dtype throughout the calculation.
Please note concerns here or in the PR.
Thanks!
Matt