code: def test_cumprod(self):
      pdf = pd.DataFrame(
          {
              "a": [1, 2, -3, 4, -5, 6] * 3,
              "b": [1, 1, 2, 3, 5, 8] * 3,
              "c": [1, 0, 9, 16, 25, 36] * 3,
          },
          index=np.random.rand(6 * 3),
      )
      psdf = ps.from_pandas(pdf)
  
      self.assert_eq(
          psdf.groupby("b").cumprod().sort_index(),
          pdf.groupby("b").cumprod().sort_index(),
          check_exact=False,
      )
      self.assert_eq(
          psdf.groupby(["a", "b"]).cumprod().sort_index(),
          pdf.groupby(["a", "b"]).cumprod().sort_index(),
          check_exact=False,
      )
      self.assert_eq(
          psdf.groupby(["b"])["a"].cumprod().sort_index(),
          pdf.groupby(["b"])["a"].cumprod().sort_index(),
          check_exact=False,
      )
      self.assert_eq(
          psdf.groupby(["b"])[["a", "c"]].cumprod().sort_index(),
          pdf.groupby(["b"])[["a", "c"]].cumprod().sort_index(),
          check_exact=False,
      )
      self.assert_eq(
          psdf.groupby(psdf.b // 3).cumprod().sort_index(),
          pdf.groupby(pdf.b // 3).cumprod().sort_index(),
          check_exact=False,
      )
      self.assert_eq(
          psdf.groupby(psdf.b // 3)["a"].cumprod().sort_index(),
          pdf.groupby(pdf.b // 3)["a"].cumprod().sort_index(),
          check_exact=False,
      )
      self.assert_eq(
          psdf.groupby("b").cumprod().sum().sort_index(),
          pdf.groupby("b").cumprod().sum().sort_index(),
          check_exact=False,
      )
      self.assert_eq(
          psdf.a.rename().groupby(psdf.b).cumprod().sort_index(),
          pdf.a.rename().groupby(pdf.b).cumprod().sort_index(),
          check_exact=False,
      )
      self.assert_eq(
          psdf.a.groupby(psdf.b.rename()).cumprod().sort_index(),
          pdf.a.groupby(pdf.b.rename()).cumprod().sort_index(),
          check_exact=False,
      )
      self.assert_eq(
          psdf.a.rename()
          .groupby(psdf.b.rename())
          .cumprod()
          .sort_index(),
          pdf.a.rename().groupby(pdf.b.rename()).cumprod().sort_index(),
          check_exact=False,
      )
  
      # multi-index columns
      columns = pd.MultiIndex.from_tuples(
          [("x", "a"), ("x", "b"), ("y", "c")]
      )
      pdf.columns = columns
      psdf.columns = columns
  
      self.assert_eq(
          psdf.groupby(("x", "b")).cumprod().sort_index(),
          pdf.groupby(("x", "b")).cumprod().sort_index(),
          check_exact=False,
      )
      self.assert_eq(
          psdf.groupby([("x", "a"), ("x", "b")]).cumprod().sort_index(),
          pdf.groupby([("x", "a"), ("x", "b")]).cumprod().sort_index(),
          check_exact=False,
      )
  
      psdf = ps.DataFrame([["a"], ["b"], ["c"]], columns=["A"])
      self.assertRaises(
          DataError, lambda: psdf.groupby(["A"]).cumprod()
      )
      psdf = ps.DataFrame(
          [[1, "a"], [2, "b"], [3, "c"]], columns=["A", "B"]
      )
      self.assertRaises(
          DataError, lambda: psdf.groupby(["A"])["B"].cumprod()
      )
  
file_path: spark/python/pyspark/pandas/tests/groupby/test_cumulative.py
imports: import unittest
  import numpy
  import pandas
  from pyspark import pandas
  from pyspark.pandas.exceptions import DataError
  from pyspark.testing.pandasutils import ComparisonTestBase
  from pyspark.testing.sqlutils import SQLTestUtils
label_desc: Use image node_id 5 for calling the GroupbyCumulativeMixin obj's underlying member method code with example usage: obj.test_cumprod() without return types