Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
stdbrouw
on Oct 27, 2013
|
parent
|
context
|
favorite
| on:
Intro to Pandas data structures
This should do the trick.
myframe['myfield'] = myframe['myfield'].dropna().map(float)
gjreda
on Oct 27, 2013
[–]
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: