From: Edward C. J. <edc...@er...> - 2002-12-12 02:47:18
|
To access UInt8, etc, from numerictypes import * Maybe mention this in 4.2.1. ------- In 4.7 Only one "..." is expanded in an index expression, so if one has a rank-5 array C, then C[...,0,...] is the same thing as C[:,:,:,0,:]. So an unexpanded "..." is treated as a ':'? ---------- In 5.1.1, >>> a = arange(5, type=Float64) >>> print a[::-1] * 1.2 [ 4.8 3.6 2.4 1.2 0. ] >>> multiply(a[::-1], 1.2, a) >>> a array([ 4.8 , 3.6 , 2.4 , 1.2, 0. ]) doesn't make the desired point. Try: >>> a = arange(5, type=Int32) >>> a [0 1 2 3 4] >>> print a[::-1] * 1.2 [ 4.8 3.6 2.4 1.2 0. ] >>> multiply(a[::-1], 1.2, a) >>> a array([4 3 2 1 0]) Why does Python documentation always use the interpreter? I doubt if it is used much. Why not: a = arange(5, type=Int32) print a.type(), a b = a[::-1] * 1.2 print b.type(), b numarray.multiply(a[::-1], 1.2, a) print a.type(), a |