We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
df = pd.DataFrame({'a': [1, 1, 2, 2, 2], 'b': [3, 4, 5, 6, 7]}) gb = df.groupby(df["a"]) print(gb.transform('size'))
raises TypeError: Transform function invalid for data types, but I think a reasonable expectation is to have the result of gb.size() broadcasted:
TypeError: Transform function invalid for data types
gb.size()
0 2 1 2 2 3 3 3 4 3 dtype: int64
where gb.size() produces
a 1 2 2 3 dtype: int64
The text was updated successfully, but these errors were encountered:
Closing as duplicate of #27469
Sorry, something went wrong.
No branches or pull requests
raises
TypeError: Transform function invalid for data types
, but I think a reasonable expectation is to have the result ofgb.size()
broadcasted:where
gb.size()
producesThe text was updated successfully, but these errors were encountered: