title: Python: Storing values in a 3D array to csv
body: <p>I have the follwoing problem. I have a 3D array like 
  <code>matrix = np.zeros((30,30,100))</code> where every entry is a coordinate and gets a value. So <code>matrix [0][0][0]</code> is the coordinate x=0,y0,z=0 and has a value of 0. Now i want to store all the values in a csv like this where the first 3 rows are the coordinates and the 4th the corresponding value:</p>
  
  <p><a href="https://i.stack.imgur.com/om8ms.png" rel="noreferrer"><img src="https://i.stack.imgur.com/om8ms.png" alt="enter image description here"></a>  </p>
  
  <p>Is there a fast way with numpy to do this?</p>