Assuming matrices1 and matrices2 are actually arrays of size (N, 3, 3)
you can do:
np.einsum('nij,njk-nik', matrices1, matrices2)
On Sun, Aug 26, 2012 at 11:04 AM, Alex Flint alex.fl...@gmail.com wrote:
I have two lists of 3x3 arrays and I would like to compute the matrix
product of the i-th
Hi,
I would like to have objects that I can mix with ndarrays in
arithmetic expressions but I need my object to have control of the
operation even when it is on the right hand side of the equation. I
realize from the documentation that the way to do this is to actually
subclass ndarray but this
by objects that are not sub-types of
the ndarray
-=- Olivier
2011/6/15 Jonathan Taylor jonathan.tay...@utoronto.ca
Hi,
I would like to have objects that I can mix with ndarrays in
arithmetic expressions but I need my object to have control of the
operation even when it is on the right hand
resorted to loops in the past to solve this
not uncommon use case so perhaps it would be helpful to more people if
it (or something similar?) was included in numpy?
Jonathan.
On Thu, Mar 10, 2011 at 12:00 PM, Jonathan Taylor
jonathan.tay...@utoronto.ca wrote:
I see.
Should functionality like
I see.
Should functionality like this be included in numpy?
Jon.
On Tue, Mar 8, 2011 at 3:39 PM, josef.p...@gmail.com wrote:
On Tue, Mar 8, 2011 at 3:03 PM, Jonathan Taylor
jonathan.tay...@utoronto.ca wrote:
I am wanting to use an array b to index into an array x with dimension
bigger
I am wanting to use an array b to index into an array x with dimension
bigger by 1 where the element of b indicates what value to extract
along a certain direction. For example, b = x.argmin(axis=1).
Perhaps I want to use b to create x.min(axis=1) but also to index
perhaps another array of the
Take a look at a nice project coming out of my department:
http://code.google.com/p/cudamat/
Best,
Jon.
On Tue, Feb 15, 2011 at 11:33 AM, Sebastian Haase seb.ha...@gmail.com wrote:
Wes,
I think I should have a couple of GPUs. I would be ready for anything
... if you think that I could do
Why does indexing seem to transpose this array?
In [14]: x = arange(8).reshape((2,2,2))
In [15]: x[0,:,:]
Out[15]:
array([[0, 1],
[2, 3]])
In [16]: x[0,:,[0,1]]
Out[16]:
array([[0, 2],
[1, 3]])
Thanks,
Jonathan.
___
NumPy-Discussion
Right... So I was able to get everything working finally. I am not
100% sure how or why it works though so I am going to outline what I
did here for reference.
I first tried just using LAPACK 3.1.1 (since it seemed set up for g77
instead of gfortran which I do not have). I compiled this to
Hi,
I am getting a strange crash in numpy.linalg.lstsq. I have put the code
that causes the crash along with two data files on my website at:
http://www.cs.toronto.edu/~jtaylor/crash/
I would be interested to know if this bug can be duplicated and/or if anyone
has any suggestions as to why:
,
Jonathan.
On Mon, Aug 17, 2009 at 3:12 PM, Charles R Harris
charlesr.har...@gmail.com wrote:
On Mon, Aug 17, 2009 at 11:42 AM, Jonathan Taylor
jonathan.tay...@utoronto.ca wrote:
Hi,
I am getting a strange crash in numpy.linalg.lstsq. I have put the code
that causes the crash along with two
:
On Mon, Aug 17, 2009 at 1:43 PM, Jonathan Taylor
jonathan.tay...@utoronto.ca wrote:
Hi,
I am using a computer that is administered. It is an intel Ubuntu box
and came with an ATLAS compiled. I thus compiled my own numpy1.3.0
against that ATLAS.
I was thinking about recompiling ATLAS
Yes... ATLAS type problems like matrix multiplication.
Is there some alternative to get a working numpy going? How might I
go about compiling numpy without ATLAS? I really got to get at least
something working temporarily.
Thanks,
Jon.
On Mon, Aug 17, 2009 at 5:03 PM, Keith
It seems to automatically detect it though. Specifically
lapack_lite.so always seems to reference libatlas.
On Mon, Aug 17, 2009 at 5:21 PM, Keith Goodmankwgood...@gmail.com wrote:
On Mon, Aug 17, 2009 at 2:13 PM, Jonathan
Taylorjonathan.tay...@utoronto.ca wrote:
Is there some alternative to
I am wondering how I might be able to compile numpy without ATLAS on a
ubuntu machine that has an atlas deb installed. It seems that the
numpy build routine automatically detects it.
Thanks for any help,
Jonathan.
___
NumPy-Discussion mailing list
Sorry. I meant to update this thread after I had resolved my issue.
This was indeed one problem. I had to set LD_LIBRARY_PATH.
I also had another odd problem that I will spell out here in hopes
that I save someone some trouble. Specifically, one should be very
sure that the path to the blas
I would also like to see this. Have we looked at using videolectures.net?
In my field, the people from videolectures.net takes care of filming
and editing. I am not sure, but they might actually be free as they
have a big grant from the EU to do this sort of thing. It might be
worth pinging
Following these instructions I have the following problem when I
import numpy. Does anyone know why this might be?
Thanks,
Jonathan.
import numpy
Traceback (most recent call last):
File stdin, line 1, in module
File /home/jtaylor/lib/python2.5/site-packages/numpy/__init__.py,
line 130, in
You lost me on
x = np.arange(30)
x.shape = (2,3,5)
For me I get:
In [2]: x = np.arange(30)
In [3]: x.shape
Out[3]: (30,)
which is what I would expect. Perhaps I missed something?
Jon.
On Wed, Mar 11, 2009 at 8:55 PM, shuwj5...@163.com shuwj5...@163.com wrote:
Hi,
import numpy as np
x
Just for other peoples reference I eventually went with a cython
version that goes about twice as fast as my old post. Here it is:
import numpy as np
cimport numpy as np
cdef extern from math.h:
double cos(double)
double sin(double)
def rotation(np.ndarray[double] theta):
cdef
Looks cool but a lot of this should be done in an extension module to
make it fast. Perhaps starting this process off as a separate entity
until stability is acheived. I would be tempted to do some of this
using cython. I just wrote found that generating a rotation matrix
from euler angles is
Hi,
I am doing optimization on a vector of rotation angles tx,ty and tz
using scipy.optimize.fmin. Unfortunately the function that I am
optimizing needs the rotation matrix corresponding to this vector so
it is getting constructed once for each iteration with new values.
From profiling I can Hi,
Sorry.. obviously having some copy and paste trouble here. The
message should be as follows:
Hi,
I am doing optimization on a vector of rotation angles tx,ty and tz
using scipy.optimize.fmin. Unfortunately the function that I am
optimizing needs the rotation matrix corresponding to this vector
Hi Dave.
This does seem like the only way to write this nicely. Unfortunately,
I think this may be wasteful memory wise (in contrast to what the
obvious matlab code would do) as it constructs an array with the whole
first index intact at first. I think I will use it anyways though as
I find the
Hi,
When solving a quadratic equation I get that alpha =
-3.78336776728e-31 which I believe to be far below machine precision:
finfo(float).eps
2.2204460492503131e-16
But an if statement like:
if alpha == 0:
...
does not catch this. Is there a better way to check for things that
are
Interesting. That makes sense and I suppose that also explains why
there is no function to do this sort of thing for you.
Jon.
On Mon, Jan 19, 2009 at 3:55 PM, Robert Kern robert.k...@gmail.com wrote:
On Mon, Jan 19, 2009 at 14:43, Jonathan Taylor
jonathan.tay...@utoronto.ca wrote:
Hi
I was needing an array representation of ndindex since ndindex only
gives an iterator but array(list(ndindex)) takes too long. There is
prob some obvious way to do this I am missing but if not feel free to
include this code which is much faster.
In [252]: time
27 matches
Mail list logo