473,547 Members | 2,532 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PyNum, A multidimensiona l array where the elements are arrays?

Hi there

I'm using Numerical Python to handle my arrays but I'm not sure how to
accomplish the following.

I want a NxNxNxN array where each element of the the array
(A[i,j,k,l]) is itself a 3x3 array. So I can then slice my array
A[:,:,i,j] into planes and start grabbing matrices from it. I need to
slice it in all possible planes and I don't want to start messing
around with nested lists.

How would I go about doing this in python, I guess in C I would have a
an NxNxNxN array full of pointers to matrix objects, but lifes to
short for C.

Thanks for any help you can give

Jack Liddle
Department Of Theoretical Physics
University Of Oxford
Jul 18 '05 #1
2 3723

"Jack Liddle" <ja**@thelobste rofmetal.com> wrote in message
news:98******** *************** **@posting.goog le.com...
Hi there

I'm using Numerical Python to handle my arrays but I'm not sure how to
accomplish the following.

I want a NxNxNxN array where each element of the the array
(A[i,j,k,l]) is itself a 3x3 array. So I can then slice my array
A[:,:,i,j] into planes and start grabbing matrices from it. I need to
slice it in all possible planes and I don't want to start messing
around with nested lists.

How would I go about doing this in python, I guess in C I would have a
an NxNxNxN array full of pointers to matrix objects, but lifes to
short for C.


Will an NxNxNxNx3x3 array not do the job? Alternatively you can have an
NxNxNxN array of type PyObject (less efficient I would think).

Duncan
Jul 18 '05 #2
In article <98************ *************@p osting.google.c om>, Jack Liddle
<ja**@thelobste rofmetal.com> writes
I'm using Numerical Python to handle my arrays but I'm not sure how to
accomplish the following.

I want a NxNxNxN array where each element of the the array
(A[i,j,k,l]) is itself a 3x3 array. So I can then slice my array
A[:,:,i,j] into planes and start grabbing matrices from it. I need to
slice it in all possible planes and I don't want to start messing
around with nested lists.

How would I go about doing this in python, I guess in C I would have a
an NxNxNxN array full of pointers to matrix objects, but lifes to
short for C.


Is there any reason not to just use an NxNxNxNx3x3 array?

If you do this then the 3x3 matrices look like A[i,j,k,l,:,:]

--
Andrew McLean
Jul 18 '05 #3

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

Similar topics

5
6742
by: Golf Nut | last post by:
I am finding that altering and affecting values in elements in multidimensional arrays is a huge pain in the ass. I cannot seem to find a consistent way to assign values to arrays. Foreach would clearly be the most efficient way to do it, but it only works on a copy of the original array and not the original (which is counter intuitive in my...
0
1570
by: deko | last post by:
How do I reference an array within an array? $mapped_array = array_map(null, $data_array, $counter_array); // okay, so now I have an array of 2 arrays - but how do I reference each array? // the next two lines fail to give an accurate count echo "Starting with ".count($mapped_array)." elements in data_array<br>"; echo "Starting with...
2
4884
by: Dave Smithz | last post by:
Hi there. Because of the lack of a Union query in MySQL 3 I have decided to take the approach where I populate two arrays with values from similar tables in DB. In this case they are `courses` and `lessons` Lets say Courses has fields CourseID(PK), Date, Name, RunBy, Status The lessons table is related to the Courses table in that a...
5
4479
by: TLOlczyk | last post by:
I have a brain cramp and I need some help. I have a chunk of code below which demonstrates a problem I have with multidimensional arrays. I want to keep it simple but something specific is getting in the way. int a; int b; int **present; int **next;
5
1933
by: TheKeith | last post by:
I can't figure out why this doesn't work: --------------------------------------------- greeting = new Array(); greeting = "hey"; greeting = "bye"; trace(greeting + greeting);
9
6654
by: Charles Banas | last post by:
i've got an interesting peice of code i'm maintaining, and i'd like to get some opinions and comments on it, hopefully so i can gain some sort of insight as to why this works. at the top of the function (which was translated from Fortran code), among other heinous and numerous declarations, is this bit: static float bbuff; static int...
10
12180
by: | last post by:
I'm fairly new to ASP and must admit its proving a lot more unnecessarily complicated than the other languages I know. I feel this is because there aren't many good official resources out there to help do the most basic things. One of the "basic" things I haven't been able to find out how to do is how to delete an item from a...
4
5513
by: Gregory.A.Book | last post by:
I'm working with displaying and manipulating very large image sets. The program handles anything from 2D images to 4D RGB volumes in a time-series. I've been using dynamically allocated arrays to accomplish this, but having recently added the ability to load and display 4D data, I've run into some significant performance issues. For a...
7
1881
by: Mrkljus | last post by:
Hi, ppl Somebody knows why this works in MSIE6 and not in MSIE7 : artPage=new Array(); artPage=new Array(); artPage=null; artPage=new Array(); artPage=1290; artPage=1291;
0
7437
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7703
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7947
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7797
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5362
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5081
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3473
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1050
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
748
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.