473,386 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

using numpy to do linear algebra

Hola~

I have a large array of points (over a million). I would like to
multiply each point in the array by a 4x4 matrix. I keep thinking
there should be an easy way to do this using numpy, but I can't figure
out the mojo to do it. Is that possible?

MO

Feb 3 '07 #1
1 1996
Michael O'Brien wrote:
Hola~

I have a large array of points (over a million). I would like to
multiply each point in the array by a 4x4 matrix. I keep thinking
there should be an easy way to do this using numpy, but I can't figure
out the mojo to do it. Is that possible?
numpy questions are best asked (and best answered!) on the numpy list.

http://www.scipy.org/Mailing_Lists

Now, you haven't given quite enough information for us to answer your question
definitively. What's the format of your array of points? Is it (N, 4) or (4, N)?
Is your (4, 4) matrix set up to left-multiply column-vectors or right-multiply
row-vectors?

I'm guessing that you have an (N, 4) array of N row-vectors and your (4, 4)
matrix is set up to left-multiply column-vectors, as is the usual case. Since
you have row-vectors and your matrix needs column-vectors, you need to transpose
the matrix and multiply it on the *right* of your vectors array.

dot(n_x_four, four_x_four.T)

If the matrix had already been set up to right-multiply row-vectors, then you
could skip the transpose.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco

Feb 3 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: 2mc | last post by:
I am finding out all kinds of ways to do things in NumPy through the many suggestions I have received. It's exciting. Thanks to all who have replied on my other threads. I'm still having...
5
by: C. Barnes | last post by:
Hi, I'm in the process of writing a Python linear algebra module. The current targeted interface is: http://oregonstate.edu/~barnesc/temp/linalg/ The interface was originally based on...
0
by: Bernard Xhumga | last post by:
hello, I present my work : a freeware, (Language C, GnuPlot). Linear algebra : (fractions, 30 packages). http://www.geocities.com/xhungab/package.html The purpose of this work is to verify...
22
by: J | last post by:
Hi I hope the title of this message indicates my question. I am looking for basic array functionality in Python and it turns out that there are all these packages which are somehow related....
15
by: nikie | last post by:
I'm a little bit stuck with NumPy here, and neither the docs nor trial&error seems to lead me anywhere: I've got a set of data points (x/y-coordinates) and want to fit a straight line through...
13
by: Gary Wessle | last post by:
Hi I am trying to install NumPy in my debian/testing linux 2.6.15-1-686. with no numpy for debian/testing, I am left alone, since the experimental version available by debian will result in a...
13
by: RS | last post by:
Hi all, I am looking for a fast, efficient (tuned for speed, not size) and mature C++ code to do some numerical work with. I have looked at the Template Numerical Toolkit, which the...
18
by: robert | last post by:
Is there a ready made function in numpy/scipy to compute the correlation y=mx+o of an X and Y fast: m, m-err, o, o-err, r-coef,r-coef-err ? Or a formula to to compute the 3 error ranges? ...
3
by: fbitonti | last post by:
ok i am trying to install the linear algebra package from the numpy package and i keep getting this error i don't know what to do with it. Can some one please help i'm new to python and kind of stuck...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.