[Python] In Python Pandas DataFrame.apply() method lambda expression is taking apply()...

Discussão em 'Python' iniciado por Stack, Maio 18, 2025.

  1. Stack

    Stack Membro Participativo

    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

    Continue reading...

Compartilhe esta Página