code: def test_rank(self, float_frame):
      sp_stats = pytest.importorskip("scipy.stats")
  
      float_frame.loc[::2, "A"] = np.nan
      float_frame.loc[::3, "B"] = np.nan
      float_frame.loc[::4, "C"] = np.nan
      float_frame.loc[::5, "D"] = np.nan
  
      ranks0 = float_frame.rank()
      ranks1 = float_frame.rank(1)
      mask = np.isnan(float_frame.values)
  
      fvals = float_frame.fillna(np.inf).values
  
      exp0 = np.apply_along_axis(sp_stats.rankdata, 0, fvals)
      exp0[mask] = np.nan
  
      exp1 = np.apply_along_axis(sp_stats.rankdata, 1, fvals)
      exp1[mask] = np.nan
  
      tm.assert_almost_equal(ranks0.values, exp0)
      tm.assert_almost_equal(ranks1.values, exp1)
  
      # integers
      df = DataFrame(
          np.random.default_rng(2)
          .integers(0, 5, size=40)
          .reshape((10, 4))
      )
  
      result = df.rank()
      exp = df.astype(float).rank()
      tm.assert_frame_equal(result, exp)
  
      result = df.rank(1)
      exp = df.astype(float).rank(1)
      tm.assert_frame_equal(result, exp)
  
imports: from datetime import datetime, timedelta
  import numpy
  import pytest
  from pandas._libs.algos import Infinity, NegInfinity
  from pandas import DataFrame, Index, Series
  import pandas._testing
label_desc: Use image node_id 1 for calling the TestRank obj's underlying member method code with example usage: obj.test_rank(float_frame) without return types