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 #9697
I think we can detect the returned values and if they are not scalars, give a nicer error message. Further a doc-note would be helpful.
In [4]: cols = pd.MultiIndex.from_tuples([('syn', 'A'), ('mis', 'A'), ('non', 'A'), ('syn', 'C'), ('mis', 'C'), ('non', 'C'), ('syn', 'T'), ('mis', 'T'), ('non', 'T'), ('syn', 'G'), ('mis', 'G'), ('non', 'G')]) In [5]: df = pd.DataFrame(np.random.randint(1, 10, (4,12)), columns=cols, index=['A', 'C', 'G', 'T']) In [6]: df.groupby(axis=1, level=1).transform(lambda z: z.div(z.sum(axis=1), axis=0)) ValueError: Length mismatch: Expected axis has 4 elements, new values have 12 elements
The text was updated successfully, but these errors were encountered:
Pull request 12474 submitted
Sorry, something went wrong.
2e4da9b
Successfully merging a pull request may close this issue.
xref #9697
I think we can detect the returned values and if they are not scalars, give a nicer error message. Further a doc-note would be helpful.
The text was updated successfully, but these errors were encountered: