使用read_stadata_from_gds时,设置param station中站点数必须大于等于25
Opened this issue · 1 comments
liuxunx1993 commented
当站点数少于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 commented
很抱歉,你反馈的问题我们未能重现,我们试了一下staion中包含10个站点时仍然能够读取。请问你是否方便把你的数据和代码共享给我们测试一下?