title: Convert 4D data array to CSV
body: <p>I have a 4D data array that I want to save as a csv file, so I can compare it to another csv file that I have, generating an dispersion graph. I have seen that it is fairly easy to convert a 1D or 2D data array to a csv file, the trouble is to do it with a 4D array.</p>
  <p>Another solution would be to drop 2 dimensions but I don't know if that is okay or if it would harm the file.</p>
  <p>Here is the array that I'm having trouble with:</p>
  <p>&lt;xarray.DataArray 'rate' (time: 2, z: 1, y: 971, x: 1315)&gt;
  dask.array&lt;stack, shape=(2, 1, 971, 1315), dtype=float64, chunksize=(1, 1, 971, 1315), chunktype=numpy.ndarray&gt;</p>
  <p>Coordinates:</p>
  <ul>
  <li>time     (time) datetime64[ns] 2022-04-03 2022-04-04</li>
  <li>x        (x) float64 -63.64 -63.62 -63.6 -63.58 ... -37.4 -37.38 -37.36</li>
  <li>y        (y) float64 -36.46 -36.44 -36.42 -36.4 ... -17.1 -17.08 -17.06</li>
  <li>z        (z) float64 0.0</li>
  </ul>
  <p>Thanks in advance.</p>