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.typecode())

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.

Any ideas?

Konrad.
--
---------------------------------------------------------------------
Konrad Hinsen
Centre de Biophysique Moléculaire, CNRS Orléans
Synchrotron Soleil - Division Expériences
Saint Aubin - BP 48
91192 Gif sur Yvette Cedex, France
Tel. +33-1 69 35 97 15
E-Mail: [EMAIL PROTECTED]
---------------------------------------------------------------------


_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to