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
xref #3599. Should prob not do this kind of inference.
In [83]: df1 = DataFrame([{"val1": 1, "val2" : 20}, {"val1":1, "val2": 19}, ...: {"val1":2, "val2": 27}, {"val1":2, "val2": 12}]) ...: In [84]: df2 = DataFrame([{"val1": 1, "val2" : 20}, {"val1":1, "val2": 19}, ...: {"val1":1, "val2": 27}, {"val1":1, "val2": 12}]) ...: In [85]: df1.groupby('val1').apply(lambda x: x.val2-x.val2.mean()) Out[85]: val1 1 0 0.5 1 -0.5 2 2 7.5 3 -7.5 Name: val2, dtype: float64 In [86]: df2.groupby('val1').apply(lambda x: x.val2-x.val2.mean()) Out[86]: val2 0 1 2 3 val1 1 0.5 -0.5 7.5 -7.5 In [87]: df2.groupby('val1', squeeze=True).apply(lambda x: x.val2-x.val2.mean()) Out[87]: 0 0.5 1 -0.5 2 7.5 3 -7.5 Name: 1, dtype: float64
[87] should a) have the correct index but this should just work w/o the squeeze kwarg
squeeze
The text was updated successfully, but these errors were encountered:
No branches or pull requests
xref #3599. Should prob not do this kind of inference.
[87] should a) have the correct index
but this should just work w/o the
squeeze
kwargThe text was updated successfully, but these errors were encountered: