[Python] Keep rows of dataframe based on column, where the column has a whole / round number...

Discussão em 'Python' iniciado por Stack, Março 4, 2025.

  1. Stack

    Stack Membro Participativo

    I have a dataframe with a float column (number), e.g.:

    value number
    1 0.98
    10 1.00
    -1 1.23
    -10 2.00


    and i only want to keep the rows of the dataframe, where the number column is a "full" number (1,2,3,...) , how can i do that? The expected output is:

    value number
    10 1.00
    -10 2.00


    this question only provides the solution how to delete all rows which a whole number How do I filter rows in a dataframe that have whole numbers in one column

    Continue reading...

Compartilhe esta Página