code: def test_split_apply_combine_on_series(self):
      pdf1 = pd.DataFrame(
          {"C": [0.362, 0.227, 1.267, -0.562], "B": [1, 2, 3, 4]}
      )
      pdf2 = pd.DataFrame({"A": [1, 1, 2, 2]})
      psdf1 = ps.from_pandas(pdf1)
      psdf2 = ps.from_pandas(pdf2)
  
      for as_index in [True, False]:
          if as_index:
  
              def sort(df):
                  return df.sort_index()
  
          else:
  
              def sort(df):
                  return df.sort_values(list(df.columns)).reset_index(
                      drop=True
                  )
  
          with self.subTest(as_index=as_index):
              self.assert_eq(
                  sort(psdf1.groupby(psdf2.A, as_index=as_index).sum()),
                  sort(pdf1.groupby(pdf2.A, as_index=as_index).sum()),
              )
              self.assert_eq(
                  sort(
                      psdf1.groupby(psdf2.A, as_index=as_index).B.sum()
                  ),
                  sort(pdf1.groupby(pdf2.A, as_index=as_index).B.sum()),
              )
              self.assert_eq(
                  sort(
                      psdf1.groupby(
                          [psdf1.C, psdf2.A], as_index=as_index
                      ).sum()
                  ),
                  sort(
                      pdf1.groupby(
                          [pdf1.C, pdf2.A], as_index=as_index
                      ).sum()
                  ),
              )
              self.assert_eq(
                  sort(
                      psdf1.groupby(
                          [psdf1.C + 1, psdf2.A], as_index=as_index
                      ).sum()
                  ),
                  sort(
                      pdf1.groupby(
                          [pdf1.C + 1, pdf2.A], as_index=as_index
                      ).sum()
                  ),
              )
  
      self.assert_eq(
          psdf1.B.groupby(psdf2.A).sum().sort_index(),
          pdf1.B.groupby(pdf2.A).sum().sort_index(),
      )
      self.assert_eq(
          (psdf1.B + 1).groupby(psdf2.A).sum().sort_index(),
          (pdf1.B + 1).groupby(pdf2.A).sum().sort_index(),
      )
  
      self.assert_eq(
          psdf1.B.groupby(psdf2.A.rename()).sum().sort_index(),
          pdf1.B.groupby(pdf2.A.rename()).sum().sort_index(),
      )
      self.assert_eq(
          psdf1.B.rename().groupby(psdf2.A).sum().sort_index(),
          pdf1.B.rename().groupby(pdf2.A).sum().sort_index(),
      )
      self.assert_eq(
          psdf1.B.rename().groupby(psdf2.A.rename()).sum().sort_index(),
          pdf1.B.rename().groupby(pdf2.A.rename()).sum().sort_index(),
      )
  
file_path: spark/python/pyspark/pandas/tests/diff_frames_ops/test_groupby_split_apply_combine.py
imports: import pandas
  from pyspark import pandas
  from pyspark.pandas.config import set_option, reset_option
  from pyspark.testing.pandasutils import PandasOnSparkTestCase
  from pyspark.testing.sqlutils import SQLTestUtils
label_desc: Use image node_id 3 for calling the GroupBySACMixin obj's underlying member method code with example usage: obj.test_split_apply_combine_on_series() and returns: df, df