Copied from roly package.
Unit test failure is on the cython side when window=1. float64 dtype is returned even when input is float32.
This functon is only used in the slow version of rankdata: bn.slow.rankdata() and bn.slow.nanrankdata().
Bug fix will come in a separate commit so that unit test failures produced by this commit will demonstrate the bugs.