[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 > > 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? >
Matplotlib uses the numerix layer to handle compatibility between all three array packages. It defines the typecode function in that package and then uses it instead of the method. -Travis _______________________________________________ Numpy-discussion mailing list [email protected] http://projects.scipy.org/mailman/listinfo/numpy-discussion
