Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This should do the trick.

    myframe['myfield'] = myframe['myfield'].dropna().map(float)


Alternatively, I think you could also do:

    myframe.myfield.dropna().astype(float)
I'd need to test that out though - type conversion in pandas/NumPy has always been a little confusing for me.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: