Firstly, when you ask a question, please don't include images of a dataframe, instead include reproducible data. Take a look at this to get some pointers about how to write a good question.
To you question, firstly, look at the source of your table. Is it in Excel for example, could you fix the problem there?
If you do need to fix the problem using pandas, here is one way:
First some sample data, with years and months mixed up in the same column.
import pandas as pd
import numpy as np
data = pd.DataFrame({
'key': ['2017', 'November', 'December', '2018', 'January']
})
First step is to extract the instance that are years into a new columns, and then "forward fill" to broadcast those values forward. In one line:
data['years'] = pd.Series([i if i.isnumeric() else np.nan for i in data['key']]).fillna(method = 'ffill')
Now, drop the rows that are years. In your data, it appears these have no data associated.
data = data[~data['key'].str.isnumeric()]
Giving us:
key years
1 November 2017
2 December 2017
4 January 2018