matplotlib does not support generators as input

后端 未结 1 1624
走了就别回头了
走了就别回头了 2021-01-14 08:57

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 pyth

相关标签:
1条回答
  • 2021-01-14 09:12

    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)
    
    0 讨论(0)
提交回复
热议问题