dimanche 16 mai 2021

Conditional doesn´t return True when it is proved that it is in Python

I have an integer value that i am finding if it exists in a dataframe column:

Integer: 196930 Dataframe column: df['COLUMN']

When i make:

In: df[df['COLUMN'] == 196930]

Out: (I get the lane with the column value without any problem)

The problem is when I use it in a conditional to prove if the value is in the column andmake another actions.

if 196930 in df['COLUMN']: ... ... ...

It returns me False value, when before i checked that it is True. Why should be this?

Thank you in advance.

Aucun commentaire:

Enregistrer un commentaire