python - numpy Invalid datetime unit generic in metadata error -
i'm working on updating else's code numpy 1.6.1 numpy 1.8.
the code giving error(and added print, won't work):
name in arr.dtype.names: print name print arr.dtype.names print arr print arr[name] set_to_nan(arr[name])
the printout , error:
time ('time', 'nsec', 'seqnum', 'message_offset', 'event_type', 'match_event_locator', 'trdpx', 'trdqty', 'trdaggr', 'trdtyp', 'trdid', 'bid', 'ask')
[ (none, 32128, -1146166105165789278, 1, 0, 0, 0.0, 0, 0, 0, '', [(0.0, 0, 0), (0.0, 0, 0), (0.0, 0, 0), (0.0, 0, 0), (0.0, 0, 0), (0.0, 0, 0), (0.0, 0, 0), (0.0, 0, 0), (0.0, 0, 0), (0.0, 0, 0)], [(0.0, 0, 0), (0.0, 0, 0), (0.0, 0, 0), (0.0, 0, 0), (0.0, -938012672, 5), (0.0, 536870912, 25211), (0.0, 0, 12288), (1.4916681462400413e-154, 527891, 0), (0.0, 48070656, 10), (0.0, 1879048192, 1)])]
error trying print arr[name]
file "/home/venv/lib/python2.7/site-packages/dat/array_utils.py", line 500, in set_to_nan print arr[name] file "/home/venv/lib/python2.7/site-packages/numpy/core/numeric.py", line 1615, in array_str return array2string(a, max_line_width, precision, suppress_small, ' ', "", str) file "/home/venv/lib/python2.7/site-packages/numpy/core/arrayprint.py", line 454, in array2string separator, prefix, formatter=formatter) file "/home/venv/lib/python2.7/site-packages/numpy/core/arrayprint.py", line 328, in _array2string _summaryedgeitems, summary_insert)[:-1] file "/home/venv/lib/python2.7/site-packages/numpy/core/arrayprint.py", line 500, in _formatarray word = format_function(a[-1]) file "/home/venv/lib/python2.7/site-packages/numpy/core/arrayprint.py", line 741, in __call__ casting=self.casting) typeerror: invalid datetime unit "generic" in metadata
if let code run without print, this:
file "/home/venv/lib/python2.7/site-packages/dat/array_utils.py", line 487, in set_to_nan arr[:] = _dtype_nan_value(arr.dtype) valueerror: cannot convert specific units generic units in numpy datetimes or timedeltas
Comments
Post a Comment