I am trying to fill some empty row cell of a column with the corresponding previous row cell. However i am not getting the right solution:
df = pd.DataFrame({'A':[1, 2, 3, 4, 5], 'B':[6, 7, '', '', 10]})
df.replace('', np.nan)
df.fillna(method='ffill')
The result is still empty. i would like to fill empty cell of column B with 3 and 4 from column A