Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

head doesn't work on grouped data frame #257

Closed
tmastny opened this issue Aug 7, 2020 · 1 comment
Closed

head doesn't work on grouped data frame #257

tmastny opened this issue Aug 7, 2020 · 1 comment
Labels
be:pandas dplyr:parity Enables a dplyr behavior type:bug Something isn't working

Comments

@tmastny
Copy link
Contributor

tmastny commented Aug 7, 2020

from siuba import *
from siuba.data import mtcars

import pandas as pd

mtcars >>\
    group_by(_.cyl) >>\
    head()
#> <siuba.dply.verbs.Pipeable at 0x11aedd6a0>
    
mtcars.groupby("cyl").head(1)
#>  mpg  cyl   disp   hp  drat    wt   qsec  vs  am  gear  carb
0  21.0    6  160.0  110  3.90  2.62  16.46   0   1     4     4
2  22.8    4  108.0   93  3.85  2.32  18.61   1   1     4     1
4  18.7    8  360.0  175  3.15  3.44  17.02   0   0     3     2

Created on 2020-08-06 by the reprexpy package

siuba/siuba/dply/verbs.py

Lines 1119 to 1121 in 1d0a376

@singledispatch2(pd.DataFrame)
def head(__data, n = 5):
return __data.head(n)

@machow
Copy link
Owner

machow commented Nov 16, 2022

resolved in v0.4.0

@machow machow closed this as completed Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
be:pandas dplyr:parity Enables a dplyr behavior type:bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

2 participants