| 1834 | |
| 1835 | @pytest.mark.parametrize("method", ["average", "min", "max"]) |
| 1836 | def test_rank_tiny_values(self, method): |
| 1837 | # GH62036: regression test for ranking with tiny float values |
| 1838 | exp = np.array([4.0, 1.0, 3.0, np.nan, 2.0], dtype=np.float64) |
| 1839 | s = Series( |
| 1840 | [5.4954145e29, -9.791984e-21, 9.3715776e-26, pd.NA, 1.8790257e-28], |
| 1841 | dtype="Float64", |
| 1842 | ) |
| 1843 | s = s.astype(object) |
| 1844 | result = algos.rank(s, method=method) |
| 1845 | tm.assert_numpy_array_equal(result, exp) |
| 1846 | |
| 1847 | def test_too_many_ndims(self): |
| 1848 | arr = np.array([[[1, 2, 3], [4, 5, 6], [7, 8, 9]]]) |