I want to fill empty cells with with previous row value if they start with number. For example, I have
Text Text
30 Text Text
Text Text
Text Text
31 Text Text
Text Text
31 Text Text
Text Text
Text Text
32 Text Text
Text Text
Text Text
Text Text
Text Text
Text Text
I however, want to have
Text Text
30 Text Text
30 Text Text
30 Text Text
31 Text Text
Text Text
31 Text Text
31 Text Text
31 Text Text
32 Text Text
Text Text
Text Text
Text Text
Text Text
Text Text
I tried to reach this by using this code:
data = pd.read_csv('DATA.csv',sep='\t', dtype=object, error_bad_lines=False)
data = data.fillna(method='ffill', inplace=True)
print(data)
but it did not work.
Is there anyway to do this?