code: def test_aggregate(self):
      pdf = pd.DataFrame(
          [[1, 2, 3], [4, 5, 6], [7, 8, 9], [np.nan, np.nan, np.nan]],
          columns=["A", "B", "C"],
      )
      psdf = ps.from_pandas(pdf)
  
      self.assert_eq(
          psdf.agg(["sum", "min"])[
              ["A", "B", "C"]
          ].sort_index(),  # TODO?: fix column order
          pdf.agg(["sum", "min"])[["A", "B", "C"]].sort_index(),
      )
      self.assert_eq(
          psdf.agg({"A": ["sum", "min"], "B": ["min", "max"]})[
              ["A", "B"]
          ].sort_index(),
          pdf.agg({"A": ["sum", "min"], "B": ["min", "max"]})[
              ["A", "B"]
          ].sort_index(),
      )
  
      self.assertRaises(
          KeyError,
          lambda: psdf.agg({"A": ["sum", "min"], "X": ["min", "max"]}),
      )
  
      # multi-index columns
      columns = pd.MultiIndex.from_tuples(
          [("X", "A"), ("X", "B"), ("Y", "C")]
      )
      pdf.columns = columns
      psdf.columns = columns
  
      self.assert_eq(
          psdf.agg(["sum", "min"])[
              [("X", "A"), ("X", "B"), ("Y", "C")]
          ].sort_index(),
          pdf.agg(["sum", "min"])[
              [("X", "A"), ("X", "B"), ("Y", "C")]
          ].sort_index(),
      )
      self.assert_eq(
          psdf.agg(
              {("X", "A"): ["sum", "min"], ("X", "B"): ["min", "max"]}
          )[[("X", "A"), ("X", "B")]].sort_index(),
          pdf.agg(
              {("X", "A"): ["sum", "min"], ("X", "B"): ["min", "max"]}
          )[[("X", "A"), ("X", "B")]].sort_index(),
      )
  
      self.assertRaises(
          TypeError,
          lambda: psdf.agg({"X": ["sum", "min"], "Y": ["min", "max"]}),
      )
  
      # non-string names
      pdf = pd.DataFrame(
          [[1, 2, 3], [4, 5, 6], [7, 8, 9], [np.nan, np.nan, np.nan]],
          columns=[10, 20, 30],
      )
      psdf = ps.from_pandas(pdf)
  
      self.assert_eq(
          psdf.agg(["sum", "min"])[[10, 20, 30]].sort_index(),
          pdf.agg(["sum", "min"])[[10, 20, 30]].sort_index(),
      )
      self.assert_eq(
          psdf.agg({10: ["sum", "min"], 20: ["min", "max"]})[
              [10, 20]
          ].sort_index(),
          pdf.agg({10: ["sum", "min"], 20: ["min", "max"]})[
              [10, 20]
          ].sort_index(),
      )
  
      columns = pd.MultiIndex.from_tuples(
          [("X", 10), ("X", 20), ("Y", 30)]
      )
      pdf.columns = columns
      psdf.columns = columns
  
      self.assert_eq(
          psdf.agg(["sum", "min"])[
              [("X", 10), ("X", 20), ("Y", 30)]
          ].sort_index(),
          pdf.agg(["sum", "min"])[
              [("X", 10), ("X", 20), ("Y", 30)]
          ].sort_index(),
      )
      self.assert_eq(
          psdf.agg(
              {("X", 10): ["sum", "min"], ("X", 20): ["min", "max"]}
          )[[("X", 10), ("X", 20)]].sort_index(),
          pdf.agg(
              {("X", 10): ["sum", "min"], ("X", 20): ["min", "max"]}
          )[[("X", 10), ("X", 20)]].sort_index(),
      )
  
      pdf = pd.DataFrame(
          [
              datetime(2019, 2, 2, 0, 0, 0, 0),
              datetime(2019, 2, 3, 0, 0, 0, 0),
          ],
          columns=["timestamp"],
      )
      psdf = ps.from_pandas(pdf)
  
      self.assert_eq(psdf.timestamp.min(), pdf.timestamp.min())
      self.assert_eq(psdf.timestamp.max(), pdf.timestamp.max())
  
      self.assertRaises(ValueError, lambda: psdf.agg(("sum", "min")))
  
imports: from datetime import datetime
  import sys
  import unittest
  from typing import List
  import numpy
  import pandas
  from pyspark import pandas
  from pyspark.loose_version import LooseVersion
  from pyspark.pandas.config import option_context
  from pyspark.testing.pandasutils import ComparisonTestBase
  from pyspark.testing.sqlutils import SQLTestUtils
label_desc: Use image node_id 11 for calling the FrameApplyFunctionMixin obj's underlying member method code with example usage: obj.test_aggregate() without return types