Skip to content

BUG: groupby.transform doesn't raise on missing arguments #26840

Closed
@ghost

Description

For Example, fillna requires method kwarg to be specified. the frame method
raises an exception if it is missing, but transform silently returns an empty frame

In [22]: df=pd.DataFrame(dict(price=[10,10,20,20,30,30],color=[10,10,20,20,30,30],cost=(100,200,300,400,500,600)))
    ...: g=df.groupby(['price'])
    ...: try:
    ...:     df.fillna()
    ...: except:
    ...:     print("Raised: OK")
    ...: try:
    ...:     g.fillna()
    ...: except:
    ...:     print("Raised: OK")
    ...: else:
    ...:     print("Raised: No, Failed")    
    ...: try:    
    ...:     g.transform('fillna')
    ...: except:    
    ...:     print("Raised: OK")
    ...: else:
    ...:     print("Raised: No, Failed")
Raised: OK
Raised: No, Failed
Raised: No, Failed

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions