[Numpy-discussion] alternative mechanism for initializing an array

David Warde-Farley dwf@cs.toronto....
Thu Jul 16 15:49:27 CDT 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