Errors in old Python notebooks and how to fix them
Python 2 · pandas · NumPy
Notebooks from courses, books and Kaggle often stop with the same few errors: the code was written for Python 2 or for an older pandas or NumPy. Each page says why the error happens, shows the fix and shows how NoteRun fixes it in one tap.
AttributeError: 'DataFrame' object has no attribute 'ix'pandas removed.ixin 1.0;.locreplaces it.SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?Python 2’sprintstatement; Python 3 needsprint(…).AttributeError: module 'numpy' has no attribute 'float'NumPy 1.24 removednp.float; Python’sfloatreplaces it.
NoteRun also fixes Colab paths (/content/…), xrange, iteritems, sklearn.cross_validation and more, and shows every change before it makes it.