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

使用read_stadata_from_gds时,设置param station中站点数必须大于等于25 #133

Open
liuxunx1993 opened this issue Jan 19, 2022 · 1 comment

Comments

@liuxunx1993
Copy link

liuxunx1993 commented Jan 19, 2022

当站点数少于25时,报错如下:

Traceback (most recent call last):
  File "D:\Anaconda3\envs\metdig\lib\site-packages\meteva\base\io\read_stadata.py", line 773, in read_stadata_from_gds
    sta.iloc[k,-1] = np.frombuffer(byteArray[ind1:(ind1 + element_len)],dtype=dtype_str)[0]
  File "D:\Anaconda3\envs\metdig\lib\site-packages\pandas\core\indexing.py", line 723, in __setitem__
    iloc._setitem_with_indexer(indexer, value, self.name)
  File "D:\Anaconda3\envs\metdig\lib\site-packages\pandas\core\indexing.py", line 1730, in _setitem_with_indexer
    self._setitem_with_indexer_split_path(indexer, value, name)
  File "D:\Anaconda3\envs\metdig\lib\site-packages\pandas\core\indexing.py", line 1817, in _setitem_with_indexer_split_path
    self._setitem_single_column(loc, value, pi)
  File "D:\Anaconda3\envs\metdig\lib\site-packages\pandas\core\indexing.py", line 1920, in _setitem_single_column
    ser._mgr = ser._mgr.setitem(indexer=(pi,), value=value)
  File "D:\Anaconda3\envs\metdig\lib\site-packages\pandas\core\internals\managers.py", line 355, in setitem
    return self.apply("setitem", indexer=indexer, value=value)
  File "D:\Anaconda3\envs\metdig\lib\site-packages\pandas\core\internals\managers.py", line 327, in apply
    applied = getattr(b, f)(**kwargs)
  File "D:\Anaconda3\envs\metdig\lib\site-packages\pandas\core\internals\blocks.py", line 925, in setitem
    if not self._can_hold_element(value):
  File "D:\Anaconda3\envs\metdig\lib\site-packages\pandas\core\internals\blocks.py", line 621, in _can_hold_element
    return can_hold_element(self.values, element)
  File "D:\Anaconda3\envs\metdig\lib\site-packages\pandas\core\dtypes\cast.py", line 2197, in can_hold_element
    if is_float(element) and element.is_integer():
AttributeError: 'numpy.float32' object has no attribute 'is_integer'
@liucouhua
Copy link
Collaborator

很抱歉,你反馈的问题我们未能重现,我们试了一下staion中包含10个站点时仍然能够读取。请问你是否方便把你的数据和代码共享给我们测试一下?

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