3 ms·
Pandas is great, nice write up. One thing I do have a issue with in pandas is the type conversion on sparse data, i.e. a column with missing values. It's a pit
by macarthy12 13y ago
Pandas is great, nice write up.
One thing I do have a issue with in pandas is the type conversion on sparse data, i.e. a column with missing values.
It's a pity you can convert that to a float for example.
- easytiger 13y agoI thought one of the things it did well was dealing with data exactly as you describe
- stdbrouw 13y agoThis should do the trick. myframe['myfield'] = myframe['myfield'].dropna().map(float)
- gjreda 13y agoAlternatively, 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.
- bp123 13y agodf.fillna(0.0)