prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Example of groupby_agg shows wrong output
  # Brief Description of Fix
  
  <!-- Please describe the fix in terms of a "before" and "after". In other words, what's not so good about the current docs
  page, and what you would like to see it become.
  
  Example starter wording is provided. -->
  
  Currently, the docs for `groupby_agg` uses `new_column_name='count'` but the result shown in the docs has column name 'size'.
  
  <img width="554" alt="image" src="https://user-images.githubusercontent.com/30731072/146632174-9b4a1022-d205-4ead-855e-76a3dccb7b7a.png">
  
  The correct column name should be 'count'.
  
  <img width="330" alt="image" src="https://user-images.githubusercontent.com/30731072/146632197-7607612a-8388-4383-846b-07ac3d7b522d.png">
  
  ```
     group  var1  count
  0      1     1      4
  1      1     1      4
  2      1     1      4
  3      1     1      4
  4      1     2      1
  5      2     1      1
  6      2     2      3
  7      2     2      3
  8      2     2      3
  9      2     3      1
  ```
  
  Seems like a simple enough fix, I'm happy to open a PR if you'ld like
  
  # Relevant Context
  
  <!-- Please put here, in bullet points, links to the relevant docs page. A few starting template points are available
  to get you started. -->
  
  - [Link to documentation page](https://pyjanitor-devs.github.io/pyjanitor/api/functions/#janitor.functions.groupby_agg)
  - [Link to exact file to be edited](https://github.com/pyjanitor-devs/pyjanitor/blob/dev/janitor/functions/groupby_agg.py)
  
  
  </issue>
  <code>
  [start of janitor/functions/groupby_agg.py]
  1 from typing import Callable, List, Union
  2 import pandas_flavor as pf
  3 import pandas as pd
  4 
  5 from janitor.utils import deprecated_alias
  6 
  7 
  8 @pf.register_dataframe_method
  9 @deprecated_alias(new_column="new_column_name", agg_column="agg_column_name")
  10 def groupby_agg(
  11     df: pd.DataFrame,
  12     by: Union[List, str],
  13     new_column_name: str,
  14     agg_column_name: str,
  15     agg: Union[Callable, str],
  16     dropna: bool = True,
  17 ) -> pd.DataFrame:
  18     """
  19     Shortcut for assigning a groupby-transform to a new column.
  20 
  21     This method does not mutate the original DataFrame.
  22 
  23     Without this function, we would have to write a verbose line:
  24 
  25     ```python
  26         df = df.assign(...=df.groupby(...)[...].transform(...))
  27     ```
  28 
  29     Now, this function can be method-chained:
  30 
  31     ```python
  32         import pandas as pd
  33         import janitor
  34         df = pd.DataFrame(...).groupby_agg(by='group',
  35                                            agg='mean',
  36                                            agg_column_name="col1"
  37                                            new_column_name='col1_mean_by_group',
  38                                            dropna = True/False)
  39     ```
  40 
  41     Functional usage syntax:
  42 
  43     ```python
  44 
  45         import pandas as pd
  46         import janitor as jn
  47 
  48         jn.groupby_agg(
  49             df,
  50             by= column name/list of column names,
  51             agg=aggregation function,
  52             agg_column_name = col,
  53             new_column_name= new column name,
  54             dropna = True/False)
  55     ```
  56 
  57     Method chaining usage syntax:
  58 
  59     ```python
  60 
  61         df.groupby_agg(
  62             by= column name/list of column names,
  63             agg=aggregation function,
  64             agg_column_name = col,
  65             new_column_name= new column name,
  66             dropna = True/False)
  67     ```
  68 
  69 
  70     :param df: A pandas DataFrame.
  71     :param by: Column(s) to groupby on, either a `str` or
  72                a `list` of `str`
  73     :param new_column_name: Name of the aggregation output column.
  74     :param agg_column_name: Name of the column to aggregate over.
  75     :param agg: How to aggregate.
  76     :param dropna: Whether or not to include null values,
  77         if present in the `by` column(s). Default is True.
  78     :returns: A pandas DataFrame.
  79     """
  80 
  81     return df.assign(
  82         **{
  83             new_column_name: df.groupby(by, dropna=dropna)[
  84                 agg_column_name
  85             ].transform(agg)
  86         }
  87     )
  88
  [end of janitor/functions/groupby_agg.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/janitor/functions/groupby_agg.py b/janitor/functions/groupby_agg.py
  --- a/janitor/functions/groupby_agg.py
  +++ b/janitor/functions/groupby_agg.py
  @@ -35,7 +35,7 @@
                                              agg='mean',
                                              agg_column_name="col1"
                                              new_column_name='col1_mean_by_group',
  -                                           dropna = True/False)
  +                                           dropna=True/False)
       ```
   
       Functional usage syntax:
  @@ -56,6 +56,41 @@
   
       Method chaining usage syntax:
   
  +    ```python
  +    df.groupby_agg(
  +        by=['group', 'var1'],
  +        agg='size',
  +        agg_column_name='var1',
  +        new_column_name='count',
  +    )
  +    ```
  +
  +           group  var1  count
  +        0      1     1      4
  +        1      1     1      4
  +        2      1     1      4
  +        3      1     1      4
  +        4      1     2      1
  +        5      2     1      1
  +        6      2     2      3
  +        7      2     2      3
  +        8      2     2      3
  +        9      2     3      1
  +
  +    If the data has null values,
  +    you can include the null values by passing `False` to `dropna`;
  +    this feature was introduced in Pandas 1.1:
  +
  +            name   type  num  nulls
  +        0  black  chair    4    1.0
  +        1  black  chair    5    1.0
  +        2  black   sofa   12    NaN
  +        3    red   sofa    4    NaN
  +        4    red  plate    3    3.0
  +
  +    Let's get the count, including the null values,
  +    grouping on `nulls` column:
  +
       ```python
   
           df.groupby_agg(
  
verification_info: {"golden_diff": "diff --git a/janitor/functions/groupby_agg.py b/janitor/functions/groupby_agg.py\n--- a/janitor/functions/groupby_agg.py\n+++ b/janitor/functions/groupby_agg.py\n@@ -35,7 +35,7 @@\n                                            agg='mean',\n                                            agg_column_name=\"col1\"\n                                            new_column_name='col1_mean_by_group',\n-                                           dropna = True/False)\n+                                           dropna=True/False)\n     ```\n \n     Functional usage syntax:\n@@ -56,6 +56,41 @@\n \n     Method chaining usage syntax:\n \n+    ```python\n+    df.groupby_agg(\n+        by=['group', 'var1'],\n+        agg='size',\n+        agg_column_name='var1',\n+        new_column_name='count',\n+    )\n+    ```\n+\n+           group  var1  count\n+        0      1     1      4\n+        1      1     1      4\n+        2      1     1      4\n+        3      1     1      4\n+        4      1     2      1\n+        5      2     1      1\n+        6      2     2      3\n+        7      2     2      3\n+        8      2     2      3\n+        9      2     3      1\n+\n+    If the data has null values,\n+    you can include the null values by passing `False` to `dropna`;\n+    this feature was introduced in Pandas 1.1:\n+\n+            name   type  num  nulls\n+        0  black  chair    4    1.0\n+        1  black  chair    5    1.0\n+        2  black   sofa   12    NaN\n+        3    red   sofa    4    NaN\n+        4    red  plate    3    3.0\n+\n+    Let's get the count, including the null values,\n+    grouping on `nulls` column:\n+\n     ```python\n \n         df.groupby_agg(\n", "issue": "Example of groupby_agg shows wrong output\n# Brief Description of Fix\r\n\r\n<!-- Please describe the fix in terms of a \"before\" and \"after\". In other words, what's not so good about the current docs\r\npage, and what you would like to see it become.\r\n\r\nExample starter wording is provided. -->\r\n\r\nCurrently, the docs for `groupby_agg` uses `new_column_name='count'` but the result shown in the docs has column name 'size'.\r\n\r\n<img width=\"554\" alt=\"image\" src=\"https://user-images.githubusercontent.com/30731072/146632174-9b4a1022-d205-4ead-855e-76a3dccb7b7a.png\">\r\n\r\nThe correct column name should be 'count'.\r\n\r\n<img width=\"330\" alt=\"image\" src=\"https://user-images.githubusercontent.com/30731072/146632197-7607612a-8388-4383-846b-07ac3d7b522d.png\">\r\n\r\n```\r\n   group  var1  count\r\n0      1     1      4\r\n1      1     1      4\r\n2      1     1      4\r\n3      1     1      4\r\n4      1     2      1\r\n5      2     1      1\r\n6      2     2      3\r\n7      2     2      3\r\n8      2     2      3\r\n9      2     3      1\r\n```\r\n\r\nSeems like a simple enough fix, I'm happy to open a PR if you'ld like\r\n\r\n# Relevant Context\r\n\r\n<!-- Please put here, in bullet points, links to the relevant docs page. A few starting template points are available\r\nto get you started. -->\r\n\r\n- [Link to documentation page](https://pyjanitor-devs.github.io/pyjanitor/api/functions/#janitor.functions.groupby_agg)\r\n- [Link to exact file to be edited](https://github.com/pyjanitor-devs/pyjanitor/blob/dev/janitor/functions/groupby_agg.py)\r\n\n", "before_files": [{"content": "from typing import Callable, List, Union\nimport pandas_flavor as pf\nimport pandas as pd\n\nfrom janitor.utils import deprecated_alias\n\n\n@pf.register_dataframe_method\n@deprecated_alias(new_column=\"new_column_name\", agg_column=\"agg_column_name\")\ndef groupby_agg(\n    df: pd.DataFrame,\n    by: Union[List, str],\n    new_column_name: str,\n    agg_column_name: str,\n    agg: Union[Callable, str],\n    dropna: bool = True,\n) -> pd.DataFrame:\n    \"\"\"\n    Shortcut for assigning a groupby-transform to a new column.\n\n    This method does not mutate the original DataFrame.\n\n    Without this function, we would have to write a verbose line:\n\n    ```python\n        df = df.assign(...=df.groupby(...)[...].transform(...))\n    ```\n\n    Now, this function can be method-chained:\n\n    ```python\n        import pandas as pd\n        import janitor\n        df = pd.DataFrame(...).groupby_agg(by='group',\n                                           agg='mean',\n                                           agg_column_name=\"col1\"\n                                           new_column_name='col1_mean_by_group',\n                                           dropna = True/False)\n    ```\n\n    Functional usage syntax:\n\n    ```python\n\n        import pandas as pd\n        import janitor as jn\n\n        jn.groupby_agg(\n            df,\n            by= column name/list of column names,\n            agg=aggregation function,\n            agg_column_name = col,\n            new_column_name= new column name,\n            dropna = True/False)\n    ```\n\n    Method chaining usage syntax:\n\n    ```python\n\n        df.groupby_agg(\n            by= column name/list of column names,\n            agg=aggregation function,\n            agg_column_name = col,\n            new_column_name= new column name,\n            dropna = True/False)\n    ```\n\n\n    :param df: A pandas DataFrame.\n    :param by: Column(s) to groupby on, either a `str` or\n               a `list` of `str`\n    :param new_column_name: Name of the aggregation output column.\n    :param agg_column_name: Name of the column to aggregate over.\n    :param agg: How to aggregate.\n    :param dropna: Whether or not to include null values,\n        if present in the `by` column(s). Default is True.\n    :returns: A pandas DataFrame.\n    \"\"\"\n\n    return df.assign(\n        **{\n            new_column_name: df.groupby(by, dropna=dropna)[\n                agg_column_name\n            ].transform(agg)\n        }\n    )\n", "path": "janitor/functions/groupby_agg.py"}]}