Skip to content
Advertisement

Tag: error-handling

Resource punkt not found. Please use the NLTK Downloader to obtain the resource: >>> import nltk >>> nltk.download(‘punkt’)

I have NLTK installed and it is going me error Resource punkt not found. Please use the NLTK Downloader to obtain the resource: import nltk nltk.download(‘punkt’) For more information see: https://www.nltk.org/data.html Attempted to load tokenizers/punkt/PY3/english.pickle Searched in: – ‘/Users/divyanshundley/nltk_data’ – ‘/Library/Frameworks/Python.framework/Versions/3.10/nltk_data’ – ‘/Library/Frameworks/Python.framework/Versions/3.10/share/nltk_data’ – ‘/Library/Frameworks/Python.framework/Versions/3.10/lib/nltk_data’ – ‘/usr/share/nltk_data’ – ‘/usr/local/share/nltk_data’ – ‘/usr/lib/nltk_data’ – ‘/usr/local/lib/nltk_data’ – ” and my code is Answer

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

Advertisement