Skip to content Skip to sidebar Skip to footer

Matplotlib Does Not Support Generators As Input

i am running the notebook at this site https://github.com/vsmolyakov/experiments_with_python/blob/master/chp01/ensemble_methods.ipynb to practice ensemble methods with python, and

Solution 1:

In that example there is a line num_est = map(int, np.linspace(1,100,20)). This produces a list in python 2.7. But in python 3 it is just a generator. The map is strange anyways, so I'd recommend to replace that line by

num_est = np.linspace(1,100,20).astype(int)

Post a Comment for "Matplotlib Does Not Support Generators As Input"