I have a little Java problem I want to translate to Python. Therefor I need a multidimensional array. In Java it looks like:
double dArray[][][] = new double[x.l
Take a look at numpy
here's a code snippet for you
import numpy as npy
d = npy.zeros((len(x)+1, len(y)+1, len(x)+len(y)+3))
d[0][0][0] = 0 # although this is unnecessary since zeros initialises to zero
d[i][j][k] = npy.inf
I don't think you need to be implementing a scientific application to justify the use of numpy. It is faster and more flexible and you can store pretty much anything. Given that I think it is probably better to try and justify not using it. There are legitimate reasons, but it adds a great deal and costs very little so it deserves consideration.
P.S. Are your array lengths right? It looks like a pretty peculiar shaped matrix...