Hi,
Thanks - this cookbook entry is very cool!
I am somewhat worried about function call overhead from the infix hack
though... on second consideration, the infix issue is not as important
as eventually boosting the speed of the inner loop to which
matrixmultiply() belongs. For those who are
David Pokorny wrote:
Hi,
Just wondering if anyone has considered macros for Python. I have one
good use case. In R, the statistical programming language, you can
multiply matrices with A %*% B (A*B corresponds to pointwise
multiplication). In Python, I have to type
import Numeric
Using numarray/pylab there's also dot:
from pylab import *
A = array(range(10))
B = array(range(10))
A * B
[ 0, 1, 4, 9,16,25,36,49,64,81,]
dot(A, B)
285
It might also make your code more readable. I would like A dot B, but even
using ipython
I can only get as close as dot A, B
Dan Farina
I seem to remember a rather ugly hack at some point in the past that
created a new operator like so
A |dot| B
where dot was an object which had the OR operator for left and right
arguments redefined seperately so that it only made sense when used
in that syntax.
I guess you could hack
Ahar got it
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/384122
Would something like that be any use?
On 18 Oct 2005, at 13:21, Alex Stapleton wrote:
I seem to remember a rather ugly hack at some point in the past that
created a new operator like so
A |dot| B
where dot was an
On Mon, 17 Oct 2005 22:23:43 -0700, David Pokorny wrote:
Hi,
Just wondering if anyone has considered macros for Python. I have one
good use case. In R, the statistical programming language, you can
multiply matrices with A %*% B (A*B corresponds to pointwise
multiplication). In Python,
Steven D'Aprano wrote:
On Mon, 17 Oct 2005 22:23:43 -0700, David Pokorny wrote:
Hi,
Just wondering if anyone has considered macros for Python. I have one
good use case. In R, the statistical programming language, you can
multiply matrices with A %*% B (A*B corresponds to pointwise
On Tue, 18 Oct 2005 13:42:21 -0700, Robert Kern wrote:
Steven D'Aprano wrote:
On Mon, 17 Oct 2005 22:23:43 -0700, David Pokorny wrote:
Hi,
Just wondering if anyone has considered macros for Python. I have one
good use case. In R, the statistical programming language, you can
multiply
Hi,
Just wondering if anyone has considered macros for Python. I have one
good use case. In R, the statistical programming language, you can
multiply matrices with A %*% B (A*B corresponds to pointwise
multiplication). In Python, I have to type
import Numeric
matrixmultiply(A,B)
which makes
David Pokorny wrote:
Hi,
Just wondering if anyone has considered macros for Python. I have one
good use case. In R, the statistical programming language, you can
multiply matrices with A %*% B (A*B corresponds to pointwise
multiplication). In Python, I have to type
import Numeric
10 matches
Mail list logo