'How to merge a row into a subcolumn in pandas?

I want to merge the years that end with '0s'(1850s, 1860s etc) into one subcolumn, just like in the original database

I imported the table in excel, but it doesn't read the ['0s'] columns as one row. Instead it splits the subcolumns into cells.

My code so far is only this:

df = pd.read_excel('C:/Users/Enas/Python_Data/Hurricanes/hurricanes.xlsx')
df.head()

 df.loc[df['Year'].str.contains('0s')]

head

the 0s that I want make a subcolumn each



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source