class_docstr: Test nonparametric.py.
docstr: Test Harrel-Davis estimation of :math:`q^{th}` quantile.
docstr_tok: ["Test","Harrel-Davis","estimation","of",":","math",":","`","q^","{","th","}","`","quantile","."]
code: def test_harrelldavis(self):
      """Test Harrel-Davis estimation of :math:`q^{th}` quantile."""
      a = [
          77,
          87,
          88,
          114,
          151,
          210,
          219,
          246,
          253,
          262,
          296,
          299,
          306,
          376,
          428,
          515,
          666,
          1310,
          2611,
      ]
      assert np.isclose(
          harrelldavis(a, quantile=0.5), 271.72120054908913
      )
      harrelldavis(x=x, quantile=np.arange(0.1, 1, 0.1))
      assert np.isclose(
          harrelldavis(a, [0.25, 0.5, 0.75])[1], 271.72120054908913
      )
      # Test multiple axis
      p = np.random.normal(0, 1, (10, 100))
  
      def func(a, axes):
          return harrelldavis(a, [0.25, 0.75], axes)
  
      np.testing.assert_array_almost_equal(
          harrelldavis(p, [0.25, 0.75], 0),
          np.apply_over_axes(func, p, 0),
      )
  
      np.testing.assert_array_almost_equal(
          harrelldavis(p, [0.25, 0.75], -1),
          np.apply_over_axes(func, p, 1),
      )
  
file_path: pingouin/pingouin/tests/test_nonparametric.py
imports: import pytest
  import scipy
  import numpy
  import pandas
  from unittest import TestCase
  from pingouin.nonparametric import mad, madmedianrule, mwu, wilcoxon, kruskal, friedman, cochran, harrelldavis
label_desc: Use image node_id 8 for calling the TestNonParametric obj's underlying member method code with example usage: obj.test_harrelldavis() and returns: harrelldavis