Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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 :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading