#You have to explode your dataframe if year column contains list:
>>> df.explode('year')
var1 year
0 a 2025
1 b 2025
1 b 2030
2 c 2023
2 c 2025
2 c 2030
2 c 2040
#If your column contains string representation of a list, you have to eval first:
>>> df.assign(year=pd.eval(df['year'])).explode('year')
var1 year
0 a 2025
1 b 2025
1 b 2030
2 c 2023
2 c 2025
2 c 2030
2 c 2040