[Numpy-discussion] alternative mechanism for initializing anarray

Citi, Luca lciti@essex.ac...
Fri Jul 17 03:29:02 CDT 2009


Hello,
all these alternative mechanisms for initializing
arrays risk to break current code. Isn't it?
Then one would need to specify the data type
with a kw argument while with the current
implementation the second argument is the data type
irregardless of whether or not it is given with
the dtype keyword.

>>> np.array(['AB','S4'])
array(['AB', 'S4'], 
      dtype='|S2')
>>> np.array('AB','S4')
array('AB', dtype='|S4')

Best,
Luca


More information about the NumPy-Discussion mailing list