[Numpy-discussion] zeros() default type in Numeric3
faltet at carabos.com
Mon Mar 28 09:03:47 CST 2005
A Dilluns 28 Març 2005 18:18, Perry Greenfield va escriure:
> This is an odd thought but why not:
> Float(shape) # defaults to 0
> UInt(shape, value=1)
> I forget if it was proposed to make the type object a constructor for
> arrays in which case this may conflict with the usage of converting the
> argument of the callable form to an array, i.e.,
> Float((2,3)) --> array([2.,3.], typecode=Float) # or whatever the name
> of the type parameter becomes
Well, why not:
Array(shape, type=Float, defvalue=None)
In the end, all three paramters are used to univoquely determine the
Array object. Moreover, "defvalue = None" would be a synonymous of the
recently introduced "empty" factory.
However, this looks suspiciously similar to the "array" factory.
Perhaps it would be nice to add this "defvalue" or "value" parameter
to the "array" factory and that's all.
>qo< Francesc Altet http://www.carabos.com/
V V Cárabos Coop. V. Enjoy Data
More information about the Numpy-discussion