Skip to content

BUG: Groupby.transform('ngroup') fails #27468

Closed
@ghost

Description

Adding tests for #27467 surfaced some bugs:

from pandas import *
df = DataFrame(dict(a=[0, 0, 0, 1, 1, 1], b=range(6)))
g = df.groupby(np.repeat([0,1], 3))
# ok
print(g.ngroup()) 
#fails
g.transform('ngroup') 
AttributeError: ("'Series' object has no attribute 'ngroup'", 'occurred at index a')

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions