bug in comparing object arrays to None (?)

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
'1.8.0'
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
False # Return value is scalar (BUG?)

On Mon, Jan 27, 2014 at 3:43 PM, Charles G. Waldman charles@crunch.iowrote:
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
'1.8.0'
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
False # Return value is scalar (BUG?)
Looks like a fix is in progress: https://github.com/numpy/numpy/pull/3514
Warren
_______________________________________________
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
participants (2)
-
Charles G. Waldman
-
Warren Weckesser