'Try to replace the nan values by pandas , but Error: Columns must be same length as key

It is a simple project in Kaggle, just imitating one blog, but failed. enter image description here

train_inf['Age']=train_inf.fillna(train_inf['Age'].median()) ValueError: Columns must be same length as key

just this code

I am searching for a long time on net. But no use. Please help or try to give some ideas how achieve this. Thanks in advance.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source