I have following code
display(ch2m_cpaf.groupby('PROVIDING_COMPANY_CODE').apply(lambda df: df, axis=0))
If I will run it with axis=0 argument, it raises
TypeError: () got an unexpected keyword argument 'axis'
But why axis=0 argument is not part of lambda expression?
I tried putting it in parenthesis, it should just return Pandas' Series object
minimal working codewhich we could simpy copy and run for tests.apply()forgroupby()don't useaxis=0- you have to remove it.df.groupby().apply()works in different way thandf.apply()- and it gets different parameters.df.groupby(...).apply(lambda data:data.apply(..., axis=0))