[Numpy-discussion] 3 comments on numarray documentation
Edward C. Jones
edcjones at erols.com
Wed Dec 11 18:48:02 CST 2002
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
More information about the Numpy-discussion
mailing list