Skip to content

Tag: error-handling

Flask handling multiple errors

I have a simple app made in Flask. It uses only POST method. It takes 2 numbers (in json) and adds them up. The application responds with the sum of these numbers (also in json). The code looks like this: I would like to do error handling. The problem is that there are a lot of these errors, e.g. for

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. Answer You are close, need