First, replace your empty cells with NaNs:
df[df[0]==""] = np.NaN
Now, Use ffill()
:
df.fillna(method='ffill')
# 0
#0 Text
#1 30
#2 30
#3 30
#4 31
#5 Text
#6 31
#7 31
#8 31
#9 32
First, replace your empty cells with NaNs:
df[df[0]==""] = np.NaN
Now, Use ffill()
:
df.fillna(method='ffill')
# 0
#0 Text
#1 30
#2 30
#3 30
#4 31
#5 Text
#6 31
#7 31
#8 31
#9 32
For further actions, you may consider blocking this person and/or reporting abuse
Rachit Avasthi -
転職カメ -
Joe Giglio, Chief Remote Officer -
Lithe -
Top comments (0)