I'm trying to replace a cell which contains certain string with its above cell:
Tried following code but it takes so long and cause error:
row, col = df.shape
for i in range(1,row):
if df.iloc[i,0] == "string":
df.iloc[i,0] = df.iloc[i-1,0]
Is there a better way to achieve this? Thanks.