How to produce the following three dimensional array?
<p>I have a cube of size <code>N * N * N</code>, say <code>N=8</code>. Each dimension of the cube is discretised to 1, so that I have labelled points <code>(0,0,0), (0,0,1)..(N,N,N)</code>. At each labelled points, I would like to assign a random value, and thus produce an array which stores value at each vertex. For example <code>val[0,0,0]=1, val[0,0,1]=1.2 val[0,1,0]=1.3</code>, ...</p>

<p>How do I write a python code to acheive this?</p>

<p>For large matrices, look into using <code>numpy</code>.  This is the problem that it's designed to solve</p>

python arrays python-2.7