Q:

Pandas set values of multiple rows of a column

I have a dataframe(train) that has an Age column in it.  This column has missing values.  I have merged it with another dataframe- static_values which also has an Age column.  I am using the below lines to substitute the missing values for the Age column in train df. 
predicted_vals = pd.merge(static_vals, train, on=['Pclass','Sex'])
# num of missing values
predicted_vals.loc[predicted_vals['Age_y'].isna(),'Age_y'].isna().sum() # 177
predicted_vals.loc[predicted_vals['Age_y'].isna(),'Age_y'] = predicted_vals.loc[predicted_vals['Age_y'].isna(),'Age_x']

After running the above lines, I run the following to see if the values have been substituted- 
predicted_vals.loc[predicted_vals['Age_y'].isna(),'Age_y']

And this is the putput I get - 
Series([], Name: Age_x, dtype: float64)

Its empty.  No assignment has happened.  The strange part is that when I check the values for the Age_x column after running the above lines, I get a blank there too. 
>>> predicted_vals.loc[predicted_vals['Age_y'].isna(),'Age_x']
Series([], Name: Age_x, dtype: float64)

Below is what the column holds right before I run the lines where I am trying to assign the missing values
>>> predicted_vals.loc[predicted_vals['Age_y'].isna(),'Age_x'].head()
3     34.240964
8     34.240964
15    34.240964
25    34.240964
34    34.240964

I searched here for similar questions here but all deal with assigning a single value to many rows.  I can't figure what's wrong here.  Any help? 

A:

Is there actually a problem here?  
predicted_vals.loc[predicted_vals['Age_y'].isna(),'Age_y'] should be empty because you have filled the values!  Try predicted_vals.loc[~predicted_vals['Age_y'].isna(),'Age_y']

