Nymeric Question, from tuple to array
Robert Kern
kern at taliesen.caltech.edu
Fri Feb 21 07:09:26 EST 2003
In article <b34v9l$50q$1 at news.tudelft.nl>,
Maurice <bertvansesamstraat at hotmail.com> writes:
> Dear all,
> I/ve a very basic question.
> In numeric I've an array data.
> When I want to know the diemsnions I use data.shape.
> The output is a tuple how can I convert this to an array again.
> I tried shapeNew=array(data.shape,Int) but it doesn't work.
array creates a new array from an existing object full of data, not a shape
specification.
Use zeros(shape[, typecode]) or ones(shape[, typecode]) to get new arrays.
> Thanks in advance,
> Maurice
--
Robert Kern
kern at caltech.edu
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
More information about the Python-list
mailing list