[SciPy-user] scipy-user list

Alan G Isaac aisaac at american.edu
Wed Sep 19 10:02:24 EDT 2007


On Wed, 19 Sep 2007, (SAST) Zakaria Ali apparently wrote:
> Im having a probleme to generalete someting like that.  
> e1=(1,0.0)
> e2=(0,1,0)
> e3=(0,0,1)

You want all of them?
Use the identity.
(See below.)

Cheers,
Alan Isaac

>>> import numpy as N
>>> dim = 5
>>> e = N.eye(dim)
>>> for j in range(dim):
...  print e[j]
...
[ 1.  0.  0.  0.  0.]
[ 0.  1.  0.  0.  0.]
[ 0.  0.  1.  0.  0.]
[ 0.  0.  0.  1.  0.]
[ 0.  0.  0.  0.  1.]





More information about the SciPy-User mailing list