docstr: Basic tests of stats.rankdata.
docstr_tok: ["Basic","tests","of","stats.rankdata","."]
code: def test_basic(self):
      """Basic tests of stats.rankdata."""
      data = [100, 10, 50]
      expected = np.array([3.0, 1.0, 2.0], dtype=np.float64)
      a = np.array(data, dtype=int)
      r = rankdata(a)
      assert_array_equal(r, expected)
      r = rankdata(data)
      assert_array_equal(r, expected)
  
      data = [40, 10, 30, 10, 50]
      expected = np.array([4.0, 1.5, 3.0, 1.5, 5.0], dtype=np.float64)
      a = np.array(data, dtype=int)
      r = rankdata(a)
      assert_array_equal(r, expected)
      r = rankdata(data)
      assert_array_equal(r, expected)
  
      data = [20, 20, 20, 10, 10, 10]
      expected = np.array(
          [5.0, 5.0, 5.0, 2.0, 2.0, 2.0], dtype=np.float64
      )
      a = np.array(data, dtype=int)
      r = rankdata(a)
      assert_array_equal(r, expected)
      r = rankdata(data)
      assert_array_equal(r, expected)
      # The docstring states explicitly that the argument is flattened.
      a2d = a.reshape(2, 3)
      r = rankdata(a2d)
      assert_array_equal(r, expected)
  
imports: import numpy
  from numpy.testing import assert_equal, assert_array_equal
  import pytest
  from scipy.stats import rankdata, tiecorrect
  from scipy._lib._util import np_long
label_desc: Use image node_id 4 for calling the TestRankData obj's underlying member method code with example usage: obj.test_basic() without return types