Brian Blais wrote:
> Hello,
>
> In my attempt to learn python, migrating from matlab, I have the following
> problem.
> Here is what I want to do, (with the wrong syntax):
>
> from numpy import *
>
> t=arange(0,20,.1)
> x=zeros(len(t),'f')
>
> idx=(t>5)
> tau=5
> x[idx]=exp(-t[idx]/tau) # <-
Robert Kern wrote:
> The traceback tells you exactly what's wrong:
>
> In [7]: x[idx] = exp(-t[idx]/tau)
> ---
> exceptions.TypeError Traceback (most recent
> call
> last)
>
yes, I saw that,
Brian Blais wrote:
> Hello,
>
> In my attempt to learn python, migrating from matlab, I have the following
> problem.
> Here is what I want to do, (with the wrong syntax):
>
> from numpy import *
>
> t=arange(0,20,.1)
> x=zeros(len(t),'f')
Also, you probably don't want to be using literal typ
Brian Blais wrote:
> Hello,
>
> In my attempt to learn python, migrating from matlab, I have the following
> problem.
> Here is what I want to do, (with the wrong syntax):
>
> from numpy import *
>
> t=arange(0,20,.1)
> x=zeros(len(t),'f')
>
> idx=(t>5)
> tau=5
> x[idx]=exp(-t[idx]/tau) # <-
Brian Blais wrote:
> Hello,
>
> In my attempt to learn python, migrating from matlab, I have the
> following problem. Here is what I want to do, (with the wrong syntax):
>
> from numpy import *
>
> t=arange(0,20,.1)
> x=zeros(len(t),'f')
>
> idx=(t>5)
> tau=5
> x[idx]=exp(-t[idx]/tau) # <---t
Brian Blais wrote:
> Colin J. Williams wrote:
>
>> Brian Blais wrote:
>>
>>> In my attempt to learn python, migrating from matlab, I have the
>>> following problem. Here is what I want to do, (with the wrong syntax):
>>>
>>> from numpy import *
>>>
>>> t=arange(0,20,.1)
>>> x=zeros(len(t),'f')
>>>
Colin J. Williams wrote:
> Brian Blais wrote:
>> In my attempt to learn python, migrating from matlab, I have the
>> following problem. Here is what I want to do, (with the wrong syntax):
>>
>> from numpy import *
>>
>> t=arange(0,20,.1)
>> x=zeros(len(t),'f')
>>
>> idx=(t>5)# <---
Howdy,On 2/17/06, Brian Blais <[EMAIL PROTECTED]> wrote:
Colin J. Williams wrote:> Brian Blais wrote:>> In my attempt to learn python, migrating from matlab, I have the>> following problem. Here is what I want to do, (with the wrong syntax):>>
>> from numpy import * t=arange(0,20,.1)>> x=zeros(
Brian Blais wrote:
> Hello,
>
> In my attempt to learn python, migrating from matlab, I have the following
> problem.
> Here is what I want to do, (with the wrong syntax):
>
> from numpy import *
>
> t=arange(0,20,.1)
> x=zeros(len(t),'f')
>
> idx=(t>5)
> tau=5
> x[idx]=exp(-t[idx]/tau) # <-
Brian Blais wrote:
> Hello,
>
> In my attempt to learn python, migrating from matlab, I have the
> following problem. Here is what I want to do, (with the wrong syntax):
>
> from numpy import *
>
> t=arange(0,20,.1)
> x=zeros(len(t),'f')
>
> idx=(t>5)# <---this produces a Boole
Hello,
In my attempt to learn python, migrating from matlab, I have the following
problem.
Here is what I want to do, (with the wrong syntax):
from numpy import *
t=arange(0,20,.1)
x=zeros(len(t),'f')
idx=(t>5)
tau=5
x[idx]=exp(-t[idx]/tau) # <---this line is wrong (gives a TypeError)
#
11 matches
Mail list logo