Why can't i filter a column by a float like i would an integer in python?

For example:

df[df['nums']==23].head() #gives what its supposed to, but 
df[df['nums']==35.0454545455].head() #gives a blank df and that value exists in the column.

>Solution :

The float value is more specific than the filter you are providing.

You could round your float value and compare or >= some value would work. A precise float unless precise to the last decimal will not work.

Leave a Reply