np.array([0,1,2]) == None出现:
FutureWarning: comparison to `None` will result in an elementwise object comparison in the future
解决方法:将 == 改为 is
Also, have you tried
is None instead of == None? AFAIK, is can not be overwritten, so numpy.array could not define an element-wise is operation.
本文介绍如何解决在使用Numpy时遇到的'FutureWarning: comparison to `None` will result in an elementwise object comparison in the future'警告。文章解释了为什么会出现此警告,并提供了解决方案,即建议使用'is None'而非'== None'进行比较。
2578





