[Numpy-discussion] bug in comparing object arrays to None (?)
warren.weckesser at gmail.com
Mon Jan 27 15:51:44 EST 2014
On Mon, Jan 27, 2014 at 3:43 PM, Charles G. Waldman <charles at crunch.io>wrote:
> Hi Numpy folks.
> I just noticed that comparing an array of type 'object' to None does
> not behave as I expected. Is this a feature or a bug? (I can take a
> stab at fixing it if it's a bug, as I believe it is).
> >>> np.version.full_version
> >>> a = np.array(['Frank', None, 'Nancy'])
> >>> a
> array(['Frank', None, 'Nancy'], dtype=object)
> >>> a == 'Frank'
> array([ True, False, False], dtype=bool)
> # Return value is an array
> >>> a == None
> # Return value is scalar (BUG?)
Looks like a fix is in progress: https://github.com/numpy/numpy/pull/3514
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion