code: def test_groupby_agg_multi_column():
      """
      Test for the case when we want to groupby one column and agg
      on another, while leaving out other columns.
      """
  
      df = pd.DataFrame(
          {
              "date": [
                  "20190101",
                  "20190101",
                  "20190102",
                  "20190102",
                  "20190304",
                  "20190304",
              ],
              "user_id": [1, 2, 1, 2, 1, 2],
              "values": [1, 2, 3, 4, 5, 6],
          }
      )
  
      df_new = df.groupby_agg(
          by=["date"],
          new_column_name="values_avg",
          agg_column_name="values",
          agg="mean",
      )
  
      expected_agg = np.array([1.5, 1.5, 3.5, 3.5, 5.5, 5.5])
      np.testing.assert_equal(df_new["values_avg"], expected_agg)
  
file_path: pyjanitor/tests/functions/test_groupby_agg.py
imports: import numpy
  import pandas
  import pytest
  from pandas.testing import assert_frame_equal
label_desc: Use image node_id 3 for calling a global function with example usage: test_groupby_agg_multi_column() without return types