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 wrote:
> I have two lists of 3x3 arrays and I would like to compute the matrix
> product of the i-th element in the firs
ibute can also be defined by objects that are not sub-types of
>> the ndarray"
>>
>> -=- Olivier
>>
>> 2011/6/15 Jonathan Taylor
>>>
>>> Hi,
>>>
>>> I would like to have objects that I can mix with ndarrays in
>>> arithm
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 i
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
wrote:
> I see.
>
> Should functionality like this be included
I see.
Should functionality like this be included in numpy?
Jon.
On Tue, Mar 8, 2011 at 3:39 PM, wrote:
> On Tue, Mar 8, 2011 at 3:03 PM, Jonathan Taylor
> wrote:
>> I am wanting to use an array b to index into an array x with dimension
>> bigger by 1 where the element o
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 sam
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 wrote:
> Wes,
> I think I should have a couple of GPUs. I would be ready for anything
> ... if you think that I could do some easy(!) CUDA p
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 mailin
and I hope this helps someone.
Jonathan.
On Mon, Aug 17, 2009 at 5:34 PM, Keith Goodman wrote:
> On Mon, Aug 17, 2009 at 2:27 PM, Jonathan
> Taylor wrote:
>> It seems to automatically detect it though. Specifically
>> lapack_lite.so always seems to reference libatlas.
>>
&g
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
NumPy
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 Goodman wrote:
> On Mon, Aug 17, 2009 at 2:13 PM, Jonathan
> Taylor wrote:
>> Is there some alternative to get a working numpy going?
:
> On Mon, Aug 17, 2009 at 1:50 PM, Jonathan
> Taylor wrote:
>> I compiled lapack and atlas from scratch using g77 but now
>> numpy.test() hangs when I try to use any numpy functionality. I think
>> I saw someone else write about this. Is this a common problem?
>
> Yes
17, 2009 at 1:43 PM, Jonathan Taylor
> 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 thi
,
Jonathan.
On Mon, Aug 17, 2009 at 3:12 PM, Charles R Harris
wrote:
>
>
> On Mon, Aug 17, 2009 at 11:42 AM, Jonathan Taylor
> wrote:
>>
>> Hi,
>>
>> I am getting a strange crash in numpy.linalg.lstsq. I have put the code
>> that causes the crash
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:
im
/usr/local/lib.
> You can remove the ones in /usr/lib or "export
> LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH".
>
> Hope it helps.
>
> Best,
>
> N
>
> On Fri, Jul 17, 2009 at 3:57 PM, Jonathan
> Taylor wrote:
>> Following these instructions I h
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 "", line 1, in
File "/home/jtaylor/lib/python2.5/site-packages/numpy/__init__.py",
line 130, in
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 the
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 wrote:
> Hi,
>
> import numpy as np
> x = np.arange(
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 ab
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 np.
al calls in your loop each time.
>>
>> I can also recommend Chapter 2 of Introduction to Robotics: Mechanics and
>> Controls by John J. Craig for more on more efficient transformations.
>>
>>
>>
>>
>>
>> On Tue, Mar 3, 2009 at 7:19 PM, Robert Kern
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,
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,
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
Am I right to assume that there is no way elegant way to interact with
slices. i.e. Is there anyway to get
a[ix_([2,3,6],:,[3,2])]
to work? So that the dimension is completely specified? Or perhaps
the only way to do this is via
a[ix_([2,3,6],range(a.shape[1]),[3,2])]
If anyone knows a bette
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 wrote:
> On Mon, Jan 19, 2009 at 14:43, Jonathan Taylor
> wrote:
>> Hi,
>>
>> When solving a
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 essent
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 a=np.array(list(np.ndindex(10,10,10,
29 matches
Mail list logo