[SciPy-User] how to do easy things in octave with numpy ?

Paweł Kwaśniewski pawel.kw at gmail.com
Mon Jan 17 05:33:51 EST 2011


Hi,

I'm not an octave user, but I tried to just type in what you wrote here, and
here's what I can tell you:

2011/1/17 MONTAGU Thierry <thierry.montagu at cea.fr>

> Hi all scipy user
>
> i wonder how to do the following easy thing in octave within a
> python/numpy script.
>
> in octave:matlab, you instantiate
>
> a= zeros(10) for example
>
>
I see, that the above gives you a 10x10 matrix of zeros. You can have the
same in python doing the following:

from numpy import *
a = zeros((10,10))



> and for example, you can do in one line
> a[2].m = 10
>
>
or do
>
> for i = 1 : length(a)
>      a[i].m = 25;
> end
>
>
As for the above, I don't quite understand what you mean -  if I try to type
this as you have given it here, I'm getting a syntax error. Can you explain
what you mean or provide working code? Maybe I need to import some packaged
before? As I said, I'm no octave user...


> How to do this with numpy ? I guess we need to create a python class ?
> any idea ?
>
> Regards
>
> --
> Thierry
>
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>



-- 
Paweł
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20110117/547f2dbf/attachment.html>


More information about the SciPy-User mailing list