vsmolyakov / experiments_with_python

experiments with python
MIT License
377 stars 275 forks source link

Please convert this notebook to Python 3 #2

Open CBrauer opened 6 years ago

CBrauer commented 6 years ago

Please convert this notebook to Python 3. I get errors in print statements and plt.errorbar.

vsmolyakov commented 6 years ago

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

ClaudeCoulombe commented 6 years ago

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!

vsmolyakov commented 6 years ago

Thanks @ClaudeCoulombe for the detailed solution!