[SciPy-user] optimize.fsolve

Ryan Krauss ryanfedora at comcast.net
Thu Aug 18 08:46:55 CDT 2005


You can do what you did as long as you initiate the list ahead of time 
with something like out=zeros((2,1),'f').

In [32]: out=zeros((2,1),'f')

In [33]: out[0]=12.3

In [34]: out[1]=-123.34564

In [35]: out
Out[35]:
[[  12.30000019,]
  [-123.34564209,]]

Howey, David A wrote:
> I still think the way that arrays are used in scipy/numeric can be a bit subtle. I wouldn't have cracked this unless I'd seen the example given in the tutorial, which uses
> 
> out = [some function]
> out.append(the next component of the vector)
> 
> obvious with hindsight, but my earlier attempt to use
> out[0] = ....
> out[1] = ....
> 
> failed
> Dave
> 
> 
> -----Original Message-----
> From: scipy-user-bounces at scipy.net on behalf of Ryan Krauss
> Sent: Thu 18/08/2005 14:28
> To: SciPy Users List
> Subject: Re: [SciPy-user] optimize.fsolve
>  
> I guess I was wrong.
> 
> Howey, David A wrote:
> 
>>page 18 of the scipy tutorial sheds more light on this. I don't think the output has to be scalar.
>>... gradually getting there!
>>Dave
>>
>>
>>
>>------------------------------------------------------------------------
>>
>>_______________________________________________
>>SciPy-user mailing list
>>SciPy-user at scipy.net
>>http://www.scipy.net/mailman/listinfo/scipy-user



More information about the SciPy-user mailing list