-
Notifications
You must be signed in to change notification settings - Fork 49
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
summarize() can't use np.sqrt #399
Comments
Hey--
from pandas import Series
import numpy as np
ser = Series([1,2,3])
# doesn't work when translated to siuba
np.sqrt(ser)
# use this
ser.pipe(np.sqrt) |
I'll work on supporting calls like |
Fixed in version from siuba.data import mtcars
from siuba import _, mutate, group_by
import numpy as np
mtcars >> group_by(_.cyl) >> mutate(res = np.sqrt(np.mean(_.hp))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi! So glad to find a tidyverse equivalent in python. I encountered the following issue:
data = pd.concat([df_human, df_sim]) >>
group_by(_.subj, _.trial, .split, .agent,.inequality) >>
summarize(reward = np.sqrt(np.mean(.reward)))
Note I wanted the square root of the mean of the variable named reward. but this gives me an error: invalid array_struct . This error doesn't show up for other np functions such as np.size, np.mean, np.std. So I'm really confused...
The text was updated successfully, but these errors were encountered: