evaluating a function in a matrix element???

March 19, 2010
7:55 a.m.
class X:
... def __mul__(self, other): ... return numpy.random.random() * other ... def __rmul__(self, other): ... return other * numpy.random.random()
Thanks for that Friedrich! I had forgotten about __mul__, __rmul__, __float__ et al. I think that using a class method instead of a function and overriding those __*__ methods is the cleaner way to do the task I need. Cheers, Frank Horowitz frank@horow.net
5602
Age (days ago)
5602
Last active (days ago)
0 comments
1 participants
participants (1)
-
Frank Horowitz