I want to substitute NaN values of column Title based on the values of column Idx. If Idx is equal to 1, then NaN must be substituted by 0, if Idx is equal to 0, then NaN Title must be equal to 1.
Title Idx
NaN 0
0 1
1 0
NaN 0
NaN 1
I tried this:
df.loc[df['Title'].isnull(), 'Title'] = 0
But of course it always puts 0. How can I add the condition here?