[SciPy-user] LiberMate was Re: Automating Matlab

Dmitrey dmitrey15 at ukr.net
Mon Feb 23 11:19:53 EST 2009


josef.pktd at gmail.com wrote:
>> Eric Schug wrote:
>>     
>>> For those interested, my new project has been uploaded sourceforge at,
>>> http://sourceforge.net/projects/libermate/
>>>
>>> Latest version now supports simple command expressions (e.g hold on)
>>>
>>>       
>
>
> from numpy import *
> import scipy
>   
I had got the same, while no scipy function has been involved in code
> I would prefer the current standard
> import numpy as np
> and keep the name space as part of the name, e.g. np.dot, np.exp, ...
>   
+1

Let me add some more cents:

instead of round(arr) it should be used arr.round() (because Python's 
round doesn't work for numpy arrays)

zeros(m,n) should be zeros((m,n))

ones(m,n) should be ones((m,n))

"end" should go to "-1" (now "xend-1")

variables of index type (for example, obtained from ind=find(...) 
replaced by ind=nonzero() or ind=where()) should not be decreased in the 
following lines with indexing, eg arr[ind] should be used instead of 
arr[ind-1]

for A=[B C ...] and A=[B;C] using A=hstack((B, C,...)) and A=vstack((B, 
C,...)) is more readable and natural than current
array(r_[c_[B], c_[C]])

Regards, D.



More information about the SciPy-User mailing list