I want to replace NaN values in one column with values in another column and a string. Sample:
date_added release_year
4 NaN 2019
I want to replace NaN values in the 'date_added' column with the string 'January 1, {release_year}'. I tried to use the following code:
for i in df.index:
df['date_added'].fillna('January 1, {}'.format(df.loc[i, 'release_year']), inplace = True)
However, the result seems not correct:
date_added release_year
5339 January 1, 2019 2016
Anybody can provide me with a solution for this?
Thanks all!