):
def __abs__(self):
l = np.sqrt(self*self.transpose())
return(l[0,0])
V1 = Vector([1,2,2])
V2 = Vector([5,0,4])
print abs(V2-2*V1)
prints 5.0, as it should.
It is very crude (no check on dimensions!), but works.
Martijn
On Thu, 2011-09-22 at 23:54 +0200
understand the docs at http://www.scipy.org/Subclasses but it
is late now.
Martijn
P.S. I know this is not strictly matplotlib related, but since MP uses
numpy so heavily, I felt free to ask.
--
All the data continuously
/actively
developed but involves more GUI code (manually binding callbacks). What
are your experiences with embedding graphs in GUIs created using wxGlade
for wxFormBuilder?
with kind regards,
Martijn
--
All the data