experiments_with_python icon indicating copy to clipboard operation
experiments_with_python copied to clipboard

Please convert this notebook to Python 3

Open CBrauer opened this issue 6 years ago • 3 comments

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

CBrauer avatar Aug 29 '17 15:08 CBrauer

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

vsmolyakov avatar Aug 29 '17 16:08 vsmolyakov

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!

ClaudeCoulombe avatar Sep 04 '17 01:09 ClaudeCoulombe

Thanks @ClaudeCoulombe for the detailed solution!

vsmolyakov avatar Sep 04 '17 01:09 vsmolyakov