Re: [Numpy-discussion] Wanted: Numeric/NumPy compatible array creation expression

2006-12-05 Thread Travis Oliphant
[EMAIL PROTECTED] wrote: > I am looking for a way to create an array of the same type as another > given array (but of different shape) that works both with Numeric and > NumPy without being unreasonably slow. In other words, I am looking > for a a replacement for the expression > > arr

Re: [Numpy-discussion] Wanted: Numeric/NumPy compatible array creation expression

2006-11-23 Thread Robert
[EMAIL PROTECTED] wrote: > On 23.11.2006, at 16:29, Robert wrote: > >>> that will *also* (not *only*) work under NumPy (where typecode() >>> became dtype.char). An obvious idea is reshaping array1 and >>> multiplying by 0., but that can become quite costly. >> timeit if *0 is really costly ... you

Re: [Numpy-discussion] Wanted: Numeric/NumPy compatible array creation expression

2006-11-23 Thread konrad . hinsen
On 23.11.2006, at 16:29, Robert wrote: >> that will *also* (not *only*) work under NumPy (where typecode() >> became dtype.char). An obvious idea is reshaping array1 and >> multiplying by 0., but that can become quite costly. > > timeit if *0 is really costly ... you'll not get it really cheaper

Re: [Numpy-discussion] Wanted: Numeric/NumPy compatible array creation expression

2006-11-23 Thread Robert
[EMAIL PROTECTED] wrote: > I am looking for a way to create an array of the same type as another > given array (but of different shape) that works both with Numeric and > NumPy without being unreasonably slow. In other words, I am looking > for a a replacement for the expression > > ar

[Numpy-discussion] Wanted: Numeric/NumPy compatible array creation expression

2006-11-23 Thread konrad . hinsen
I am looking for a way to create an array of the same type as another given array (but of different shape) that works both with Numeric and NumPy without being unreasonably slow. In other words, I am looking for a a replacement for the expression array2 = Numeric.zeros(shape, array1.