title: Convert netCDF files to csv
body: <p>I'm struggling to convert several Berekeley Earth netCDF files into CSV or another tabular format. I realize similar questions have been raised before, but I couldn't apply any of the solutions I came across.</p>
  
  <p>For instance, <a href="http://berkeleyearth.lbl.gov/auto/Global/Gridded/Complete_TAVG_EqualArea.nc" rel="nofollow noreferrer">this dataset</a>.</p>
  
  <ul>
  <li><code>ncdump</code> from the netCDF utilities does not appear to generate an actual CSV file. I couldn't find any instruction on how to do so.</li>
  <li>I've tried loading the data into a <code>pandas</code> dataframe with <code>xarray.to_dataframe()</code>, but my notebook cannot allocate the required memory.</li>
  </ul>
  
  <pre class="lang-py prettyprint-override"><code>In [1]: import xarray as xr
  
  In [2]: import pandas as pd
  
  In [3]: nc = xr.open_dataset('Complete_TAVG_Daily_EqualArea.nc')
  
  In [4]: nc
  Out[4]:
  &lt;xarray.Dataset&gt;
  Dimensions:      (map_points: 5498, time: 50769)
  Dimensions without coordinates: map_points, time
  Data variables:
      longitude    (map_points) float32 ...
      latitude     (map_points) float32 ...
      date_number  (time) float64 ...
      year         (time) float64 ...
      month        (time) float64 ...
      day          (time) float64 ...
      day_of_year  (time) float64 ...
      land_mask    (map_points) float64 ...
  
  In [5]: df = nc.to_dataframe()
  ---------------------------------------------------------------------------
  MemoryError                               Traceback (most recent call last)
  (...)
  
  MemoryError: Unable to allocate 532. MiB for an array with shape (279127962,) and data type int16
  </code></pre>
  
  <ul>
  <li>I've tried converting with <code>Panoply</code>. CSV export appears to work only to export a single variable (which I'd like to see as a column) into a single-line file.</li>
  </ul>
  
  <p>I must be missing something. Can someone help me?</p>