[SciPy-user] scipy-user list

lorenzo bolla lbolla at gmail.com
Wed Sep 19 08:39:00 EDT 2007


In [9]: dim = 10

In [10]: j = 2

In [11]: (numpy.arange(dim)==j).astype(float)
Out[11]: array([ 0.,  0.,  1.,  0.,  0.,  0.,  0.,  0.,  0.,  0.])
L.



On 9/19/07, Zakaria Ali <zakaria at aims.ac.za> wrote:
>
> Hello
>
> Im having a probleme to generalete someting like that.
>
> e1=(1,0.0)
> e2=(0,1,0)
> e3=(0,0,1)
>
> I want to generalete ej=(0,...,0,...,   ) and in position number j I want
> to  have 1
> Are there  command in python for this?
> But how I can do the generalisation of this?
>
> I'm looking  for an answer of the form  ej = (0,0,...,o...,0) and positin
> j, I       want to have 1.
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20070919/36b35e3e/attachment.html>


More information about the SciPy-User mailing list