[SciPy-user] vector subtraction error

Ryan Krauss ryanlists at gmail.com
Sat Jan 7 13:02:33 CST 2006


I am still using old scipy, so maybe this is no longer an issue in the
new NumPy, but I seem to do this to myself a fair ammount.  I think I
have to 1-d vectors and I need to subtract them, but some how there
shapes are (n,) and (n,1)  and when I subtract them I get something
that is shape (n,n):

(Pdb) shape(cb.dBmag())
Out[3]: (4250,)
(Pdb) shape(curb.dBmag())
Out[3]: (4250, 1)
(Pdb) temp=cb.dBmag()-curb.dBmag()
(Pdb) shape(temp)
Out[3]: (4250, 4250)

Would there be a terrible performance cost to check for this when
array subtraction is called?  Would this be different in the new
NumPy?

Thanks,

Ryan



More information about the SciPy-user mailing list