[Numpy-discussion] alternative mechanism for initializing an array

David Warde-Farley dwf at cs.toronto.edu
Thu Jul 16 16:49:27 EDT 2009


On 16-Jul-09, at 3:09 PM, Keith Goodman wrote:

> def myarray(*args, **kwargs):
>    return np.array([z for z in args], **kwargs)


This version is better IMHO, because then you can still specify the  
dtype by keyword. although (just to be a pedant)

> return np.array(args, **kwargs)

works as well. :)

David



More information about the NumPy-Discussion mailing list