class_docstr: Test nonparametric.py.
docstr: Test function kruskal
docstr_tok: ["Test","function","kruskal"]
code: def test_kruskal(self):
      """Test function kruskal"""
      x_nan = x.copy()
      x_nan[10] = np.nan
      df = pd.DataFrame(
          {
              "DV": np.r_[x_nan, y, z],
              "Group": np.repeat(["A", "B", "C"], 100),
          }
      )
      kruskal(data=df, dv="DV", between="Group")
      summary = kruskal(data=df, dv="DV", between="Group")
      # Compare with SciPy built-in function
      H, p = scipy.stats.kruskal(x_nan, y, z, nan_policy="omit")
      assert np.isclose(H, summary.at["Kruskal", "H"])
      assert np.allclose(p, summary.at["Kruskal", "p-unc"])
  
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 5 for calling the TestNonParametric obj's underlying member method code with example usage: obj.test_kruskal() without return types