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.