473,480 Members | 3,098 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

PyNum, A multidimensional 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 3720

"Jack Liddle" <ja**@thelobsterofmetal.com> wrote in message
news:98*************************@posting.google.co m...
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*************************@posting.google.com> , Jack Liddle
<ja**@thelobsterofmetal.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
6730
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...
0
1566
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? //...
2
4876
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`...
5
4473
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...
5
1922
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
6650
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...
10
12161
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...
4
5505
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...
7
1880
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
7055
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
6920
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...
0
7061
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,...
0
7110
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...
1
6763
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5367
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3015
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1313
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
574
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.