experiments_with_python
experiments_with_python copied to clipboard
Please convert this notebook to Python 3
Please convert this notebook to Python 3. I get errors in print statements and plt.errorbar.
It may be helpful to use the print function from the future module:
from __future__ import print_function
I was using version 2.0.2 of matplotlib, perhaps updating matplotlib can solve the plt.errorbar problem:
sudo pip3 install --upgrade matplotlib
Conversion to Python 3 was very easy...
You've just to add parenthesis to print statement. print("Accuracy: %.2f (+/- %.2f) [%s]" %(scores.mean(), scores.std(), label))
And enlist some maps for the new errorbar API num_est = list(map(int, np.linspace(1,100,20)))
The only non-critical problem was mysterious warnings that was not able to figure exactly the origin although I've updated, mlxtend, matplotlib and numpy... Anyway, I would not spend a lot of time on more cosmetic issue.
« MaskedArrayFutureWarning: In the future the default for ma.maximum.reduce will be axis=0, not the current None, to match np.maximum.reduce. Explicitly pass 0 or None to silence this warning. return self.reduce(a) »
Thank you Vadim!
Thanks @ClaudeCoulombe for the detailed solution!