Closed
Description
In all past versions of NumPy dating back at least a decade, using astype(bool) on a str of '0' obtained False and on any other integer as True. Now the result is always True.
Reproducing code example:
import numpy as np
np.asarray(['0', '1']).astype('bool')
Before 1.18.3:
array([False, True], dtype=bool)
After 1.18.3:
array([True, True], dtype=bool)
Numpy/Python version information:
1.18.3 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit (AMD64)]
Other Thoughts
Seems to have been introduced by #15929. The prior behavior was logical, and saved execution time doing multiple type conversions.