[Python] How to slice column values in pandas DataFrame

Discussão em 'Python' iniciado por Stack, Julho 2, 2025.

  1. Stack

    Stack Membro Participativo

    I have a dataframe like this-

    element id year month days tmax tmin
    0 MX17004 2010 1 d1 NaN NaN
    1 MX17004 2010 1 d10 NaN NaN
    2 MX17004 2010 1 d11 NaN NaN
    3 MX17004 2010 1 d12 NaN NaN
    4 MX17004 2010 1 d13 NaN NaN


    where I want to further break days column like this

    days
    1
    10
    11
    12
    13


    I have tried a couple of ways, but not successful in getting the output.

    Continue reading...

Compartilhe esta Página