We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
df = pd.DataFrame({"g":[1, 2, 2, 2], "a":[1, 2, 3, 4], "b":[5, 6, 7, 8]}) df.groupby("g").apply(lambda x:x.copy())
raise
ValueError: Shape of passed values is (3, 4), indices imply (3, 2)
but lambda x:x or lambda x:x[:] works.
lambda x:x
lambda x:x[:]