Understanding the execution of DataFrame in python
问题 I am new to python and i want to understand how the execution takes place in a DataFrame. let's try this with an example from the dataset found in the kaggle.com( Titanic: Machine Learning from Disaster ). I wanted to replace the NaN value with the mean() for the respective sex . ie. the NaN value for Men should be replaced by the mean of the mens age and vice versa. now i achieved this by using this line of code _data['new_age']=_data['new_age'].fillna(_data.groupby('Sex')['Age'].transform(