id name 0 toto 1 tata 0 NaN
I would like to impute the name column missing value on the third row based on the id.
The desired dataframe would be:
id name 0 toto 1 tata 0 toto
I did the following:
df.loc[df.name.isna(), "name"] = df["id"].map(df["name"])
but it is not working.