Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Micaps站点数据读取出错,一些包含星号**的数据无法正确读取,建议改进 #8

Open
jiangleads opened this issue Mar 27, 2020 · 1 comment

Comments

@jiangleads
Copy link

为了读取micaps diamond 1 格式的数据,参考nmc_met_io-master/examples/retrieve_micaps_model.ipynb的相关语句,我使用如下语句读取,但是在遇到错误,不能读取星号数据,建议改进:

>>> from nmc_met_io.read_micaps import read_micaps_1
>>> data = read_micaps_1("/mnt/d/datafile/surface/plot/20020402.000")
Traceback (most recent call last):
  File "pandas/_libs/lib.pyx", line 1926, in pandas._libs.lib.maybe_convert_numeric
ValueError: Unable to parse string "****"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/dist-packages/nmc_met_io-0.1.0-py3.6.egg/nmc_met_io/read_micaps.py", line 95, in read_micaps_1
  File "/usr/local/lib/python3.6/dist-packages/pandas/core/tools/numeric.py", line 150, in to_numeric
    values, set(), coerce_numeric=coerce_numeric
  File "pandas/_libs/lib.pyx", line 1963, in pandas._libs.lib.maybe_convert_numeric
ValueError: Unable to parse string "****" at position 1021
@NMC-DAVE
Copy link
Member

已经增加对非数字型字符串的处理,目前"****"将会处理成NAN值,可以见例子 https://github.com/nmcdev/nmc_met_io/blob/master/examples/retreive_micaps_files.ipynb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants