How to forward fill missing values

User 570 | 1/20/2016, 10:01:44 AM

Hello

How to forward fill missing values without iterating through array?

import sframe sfraw = sframe.SFrame({'a':[1, None, 3, None, None]}) sftarget=sframe.SFrame({'a':[1, 1, 3, 3, 3]})

I'm using open source Dato Core 1.8

thanks!

Comments

User 16 | 1/25/2016, 9:04:05 PM

MindisZ -

Check out fillna.

If you wanted to replace all the None values in sf_raw with a value of zero, you could just do:

sf_raw.fillna('a', 0)