From: Evan M. <eva...@gm...> - 2009-05-10 02:31:28
|
Hi, I want to use mlab.load to load in some data: 1) 2004/02/27 21:51:00 1 2553.51 2553.51 -99.0000N 3.217 2) 2004/02/27 22:01:00 2 2553.47 2553.47 -99.0000N 3.217 3) 2004/02/27 22:10:59 3 2553.45 2553.45 -99.0000N 3.218 4) 2004/02/27 22:20:59 4 2553.46 2553.46 -99.0000N 3.223 unfortunately missing values are given as -99.000N, and these cause the following error: In [98]: mlab.load(site_file,skiprows=29,usecols=[4]) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) /Users/evan/python/tools/fig_NEA_seas_paper_RAPID.py in <module>() ----> 1 2 3 4 5 /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/mlab.pyc in load(fname, comments, delimiter, converters, skiprows, usecols, unpack, dtype) 1458 if usecols is not None: 1459 vals = splitfunc(line) -> 1460 row = [converterseq[j](vals[j]) for j in usecols] 1461 else: 1462 row = [converterseq[j](val) ValueError: invalid literal for float(): -99.00N Is there any way around this, apart from editing all the data files to remove every 'N'? Many thanks, Evan |