title: Generating a NetCDF from a text file
body: <p>Using Python can I open a text file, read it into an array, then save the file as a NetCDF?</p>
  
  <p>The following script I wrote was not successful.</p>
  
  <pre><code>import os
  import pandas as pd
  import numpy as np
  import PIL.Image as im
  
  path = 'C:\path\to\data'
  grb = [[]]
  for fn in os.listdir(path):
      file = os.path.join(path,fn)
      if os.path.isfile(file):
          df = pd.read_table(file,skiprows=6)
          grb.append(df)
  
          df2 = pd.np.array(grb)
  
          #imarray = im.fromarray(df2) ##cannot handle this data type
  
          #imarray.save('Save_Array_as_TIFF.tif')
  </code></pre>