Is possible pass `Series` to `groupby.head` ?
From this [answer](https://stackoverflow.com/a/64988556/2901002)  working  returned first top groups from another column:

    
    data = {'month': ['Jan','Jan','Jan','Jan','Feb','Feb','Feb','Feb','Feb','Feb'],
       'userid': ['2345','2345','2345','2345', '2345','2345','2345','5678', '5678', '5678'],
       'cntr': [3,3,3,3,1,1,1,2,2,2]}
    
    df = pd.DataFrame(data = data, columns = ['month','userid','cntr'])
    
    
    df1 = df.groupby(['month','userid']).head(df.cntr.astype(int))
    print (df1)
      month userid  cntr
    0   Jan   2345     3
    1   Jan   2345     3
    2   Jan   2345     3
    4   Feb   2345     1
    7   Feb   5678     2
    8   Feb   5678     2

If different values is used first value of group:

    
    data = {'month': ['Jan','Jan','Jan','Jan','Feb','Feb','Feb','Feb','Feb','Feb'],
       'userid': ['2345','2345','2345','2345', '2345','2345','2345','5678', '5678', '5678'],
       'cntr': [2,3,3,3,1,1,1,2,2,2]}
    
    df = pd.DataFrame(data = data, columns = ['month','userid','cntr'])
    df1 = df.groupby(['month','userid']).head(df.cntr.astype(int))
    print (df1)
      month userid  cntr
    0   Jan   2345     2
    1   Jan   2345     3
    2   Feb   2345     1
    3   Feb   5678     2
    4   Feb   5678     2


---

If it is valid way, why is not mentioned it in documentation, [link](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.core.groupby.GroupBy.head.html)?

If it is not valid, why not rase error?

Thank you.


If necessary:


    print (pd.show_versions())
    
    
    INSTALLED VERSIONS
    ------------------
    commit           : 2a7d3326dee660824a8433ffd01065f8ac37f7d6
    python           : 3.8.5.final.0
    python-bits      : 64
    OS               : Windows
    OS-release       : 7
    Version          : 6.1.7601
    machine          : AMD64
    processor        : Intel64 Family 6 Model 60 Stepping 3, GenuineIntel
    byteorder        : little
    LC_ALL           : None
    LANG             : en
    LOCALE           : Slovak_Slovakia.1250
    
    pandas           : 1.1.2
    numpy            : 1.19.1
    pytz             : 2020.1
    dateutil         : 2.8.1
    pip              : 20.2.3
    setuptools       : 49.6.0.post20200925
    Cython           : 0.29.21
    pytest           : 6.1.0
    hypothesis       : None
    sphinx           : 3.2.1
    blosc            : None
    feather          : None
    xlsxwriter       : 1.3.4
    lxml.etree       : 4.5.2
    html5lib         : 1.1
    pymysql          : None
    psycopg2         : None
    jinja2           : 2.11.2
    IPython          : 7.18.1
    pandas_datareader: 0.9.0
    bs4              : 4.9.1
    bottleneck       : 1.3.2
    fsspec           : 0.8.0
    fastparquet      : None
    gcsfs            : None
    matplotlib       : 3.3.1
    numexpr          : 2.7.1
    odfpy            : None
    openpyxl         : 3.0.5
    pandas_gbq       : None
    pyarrow          : None
    pytables         : None
    pyxlsb           : None
    s3fs             : None
    scipy            : 1.5.0
    sqlalchemy       : 1.3.19
    tables           : 3.6.1
    tabulate         : None
    xarray           : None
    xlrd             : 1.2.0
    xlwt             : 1.3.0
    numba            : 0.51.2
    None