1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Python] Problem when try to filter column in pandas [duplicate]

Discussão em 'Python' iniciado por Stack, Outubro 3, 2024 às 13:32.

  1. Stack

    Stack Membro Participativo

    In this example, I'm filtering some values.

    df = pd.DataFrame([{'A': -23.972176, 'B': -51.408777, 'C': np.NaN}, {'A': -23.972176, 'B': -49.959970, 'C': np.NaN}, {'A': -23.972176, 'B': -46.310840, 'C': 46.541667}])
    df[df['B']==-46.310840]


    When I did this, it returned the last row, as it should be.

    But, I'm working in a data frame with 591624 rows × 4 columns. The columns are Date, Latitude, Longitude, and Values.

    [​IMG]

    I want to filter the specific latitude and longitude.

    df[df['lat']==-23.972176]


    But, when I try to filter a particular latitude, it returns nothing. This specific latitude should appear more than 1800 times. I know that this latitude is in the DataFrame.

    What could be happening?

    The Latitude, Longitude, and MP10 are float64, and time is datetime64[ns].

    Continue reading...

Compartilhe esta Página