MCPcopy
hub / github.com/pandas-dev/pandas / test_rank_tiny_values

Method test_rank_tiny_values

pandas/tests/test_algos.py:1836–1845  ·  view source on GitHub ↗
(self, method)

Source from the content-addressed store, hash-verified

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]]])

Callers

nothing calls this directly

Calls 4

SeriesClass · 0.90
arrayMethod · 0.45
astypeMethod · 0.45
rankMethod · 0.45

Tested by

no test coverage detected