Author: Not specified Language: text
Description: Not specified Timestamp: 2018-03-20 03:43:49 +0000
View raw paste Reply
  1. import matplotlib
  2. matplotlib.use('Agg')
  3. import matplotlib.pylab as plt
  4.  
  5. from dypy.lagranto import Tra
  6. filename = 'testdata/traj.1'
  7. trajs = Tra()
  8. trajs.load_ascii(filename)
  9.  
  10. ---------------------------------------------------------------------------
  11. ValueError                                Traceback (most recent call last)
  12. <ipython-input-2-ba7a7ff34351> in <module>()
  13.       2 filename = 'testdata/traj.1'
  14.       3 trajs = Tra()
  15. ----> 4 trajs.load_ascii(filename)
  16.  
  17. /usr/lib/python2.7/site-packages/lagranto/lagranto.pyc in load_ascii(self, filename, usedatetime, msv, gz)
  18.     301                                                   usedatetime=usedatetime,
  19.     302                                                   msv=msv,
  20. --> 303                                                   gz=gz)
  21.     304     load_ascii.__doc__ = from_ascii.__doc__
  22.     305
  23.  
  24. /usr/lib/python2.7/site-packages/lagranto/formats.pyc in from_ascii(filename, usedatetime, msv, gz)
  25.     483     array = np.genfromtxt(filename, skip_header=5, names=variables,
  26.     484                           missing_values=msv, dtype=dtypes,
  27. --> 485                           converters=converters, usemask=True)
  28.     486     for var in variables:
  29.     487         if (var == 'time') and usedatetime:
  30.  
  31. /usr/lib64/python2.7/site-packages/numpy/lib/npyio.pyc in genfromtxt(fname, dtype, comments, delimiter, skiprows, skip_header, skip_footer, converters, missing, missing_values, filling_values, usecols, names, excludelist, deletechars, replace_space, autostrip, case_sensitive, defaultfmt, unpack, usemask, loose, invalid_raise)
  32.    1761     # Construct the final array
  33.    1762     if usemask:
  34. -> 1763         output = output.view(MaskedArray)
  35.    1764         output._mask = outputmask
  36.    1765     if unpack:
  37.  
  38. /usr/lib64/python2.7/site-packages/numpy/ma/core.pyc in __array_finalize__(self, obj)
  39.    2800         if self.dtype.names:
  40.    2801             if self._fill_value is None:
  41. -> 2802                 self._fill_value = _check_fill_value(None, self.dtype)
  42.    2803         return
  43.    2804
  44.  
  45. /usr/lib64/python2.7/site-packages/numpy/ma/core.pyc in _check_fill_value(fill_value, ndtype)
  46.     398             descr = ndtype.descr
  47.     399             fill_value = np.array(_recursive_set_default_fill_value(descr),
  48. --> 400                                   dtype=ndtype,)
  49.     401         else:
  50.     402             fill_value = default_fill_value(ndtype)
  51.  
  52. ValueError: Error parsing datetime string "?" at position 0
  53.  
  54.  
  55.  
View raw paste Reply