Adding to an old discussion thread (see below) ... an implementation
of the proposed functionality:
from numpy import rollaxis
def moveaxis(a, i, j = 0):
"""
move axis i of array a to position j
"""
n = a.ndim
i = i if i >= 0 else i + n
if j > i:
return rollaxis(a,
>
> >> It's supposed to take 2 matrixes, each (1004, 13) and do element-wise
> >> multiply,
> >> then sum over axis 0.
> >>
>
> Can I use tensordot to do what I want?
No. In your case I'd just do (a*b.conj()).sum(0). (Assuming that a and b
are arrays, not matrices).
It is most helpful to think
On 02/15/2013 06:29 PM, Robert Kern wrote:
> On Fri, Feb 15, 2013 at 3:58 PM, Juan Luis Cano wrote:
>> Hello all, I have a brief question about the general purpose of
>> Numpy-discussion. I suscribed a month ago more or less to keep an eye on
>> NumPy development (and perhaps contributing eventual
On Fri, Feb 15, 2013 at 3:58 PM, Juan Luis Cano wrote:
> Hello all, I have a brief question about the general purpose of
> Numpy-discussion. I suscribed a month ago more or less to keep an eye on
> NumPy development (and perhaps contributing eventually), for I saw that
> some decisions about the r
Bradley M. Froehle wrote:
> Hi Neal:
>
> The tensordot part:
> np.tensordot (a, b.conj(), ((0,),(0,))
>
> is returning a (13, 13) array whose [i, j]-th entry is sum( a[k, i] *
> b.conj()[k, j] for k in xrange(1004) ).
>
> -Brad
>
>
> The print statement outputs this:
>>
>> (1004, 13) (100
Hi Neal:
The tensordot part:
np.tensordot (a, b.conj(), ((0,),(0,))
is returning a (13, 13) array whose [i, j]-th entry is sum( a[k, i] *
b.conj()[k, j] for k in xrange(1004) ).
-Brad
The print statement outputs this:
>
> (1004, 13) (1004, 13) (13,) (13, 13)
>
> The correct output should b
Hello all, I have a brief question about the general purpose of
Numpy-discussion. I suscribed a month ago more or less to keep an eye on
NumPy development (and perhaps contributing eventually), for I saw that
some decisions about the roadmap were discussed here, but 90 % of the
emails that arri
In the following code
c = np.multiply (a, b.conj())
d = np.abs (np.sum (c, axis=0)/rows)
d2 = np.abs (np.tensordot (a, b.conj(), ((0,),(0,)))/rows)
print a.shape, b.shape, d.shape, d2.shape
The 1st compute steps, where I do multiply and then sum g
Hi all,
please do NOT respond to this thread or to me directly. This is
strictly to spread this message as widely as possible, so that anyone
who receives it and can act on it does so. Needless to say, do
forward this to anyone you think might be in a position to take useful
action.
The Python