code: def test_pivot_table(self):
      pdf = pd.DataFrame(
          {
              "a": [4, 2, 3, 4, 8, 6],
              "b": [1, 2, 2, 4, 2, 4],
              "e": [10, 20, 20, 40, 20, 40],
              "c": [1, 2, 9, 4, 7, 4],
              "d": [-1, -2, -3, -4, -5, -6],
          },
          index=np.random.rand(6),
      )
      psdf = ps.from_pandas(pdf)
  
      self.assert_eq(
          psdf.pivot_table(
              index=["c"],
              columns="a",
              values=["b", "e", "d"],
              aggfunc="sum",
          ).sort_index(),
          pdf.pivot_table(
              index=["c"],
              columns="a",
              values=["b", "e", "d"],
              aggfunc="sum",
          ).sort_index(),
          almost=True,
      )
  
      self.assert_eq(
          psdf.pivot_table(
              index=["c"],
              columns="a",
              values=["b", "e"],
              aggfunc={"b": "mean", "e": "sum"},
          ).sort_index(),
          pdf.pivot_table(
              index=["c"],
              columns="a",
              values=["b", "e"],
              aggfunc={"b": "mean", "e": "sum"},
          ).sort_index(),
          almost=True,
      )
  
      self.assert_eq(
          psdf.pivot_table(
              index=["e", "c"], columns="a", values="b"
          ).sort_index(),
          pdf.pivot_table(
              index=["e", "c"], columns="a", values="b"
          ).sort_index(),
          almost=True,
      )
  
      self.assert_eq(
          psdf.pivot_table(
              index=["e", "c"], columns="a", values="b", fill_value=999
          ).sort_index(),
          pdf.pivot_table(
              index=["e", "c"], columns="a", values="b", fill_value=999
          ).sort_index(),
          almost=True,
      )
  
file_path: spark/python/pyspark/pandas/tests/computation/test_pivot_table_adv.py
imports: import unittest
  import numpy
  import pandas
  from pyspark import pandas
  from pyspark.testing.pandasutils import ComparisonTestBase
  from pyspark.testing.sqlutils import SQLTestUtils
label_desc: Use image node_id 1 for calling the PivotTableAdvMixin obj's underlying member method code with example usage: obj.test_pivot_table() without return types