Skip to content

第一类数据读取过程中遇到的bug #42

Description

@Yes-Maaan

在读取第一类数据时,出现如下bug:
File D:\Software\Miniconda3\envs\data_get\Lib\site-packages\nmc_met_io\read_micaps.py:84, in read_micaps_1(fname, limit)
82 if (len(txt) % 24) == 0:
83 txt = np.array(txt)
---> 84 txt.shape = [number, 24]
85 else:
86 txt = np.array(txt)
ValueError: cannot reshape array of size 80184 into shape (3084,24)

原因是number=80184既是24也是26的公倍数,我的文件中有26列数据。因此应该将txt的shape变为(3084,26)。

将报错描述中的“if (len(txt) % 24) == 0: ”代码修改如下,即可正常运行
if (len(txt) % 24 == 0) & (number * 24 == len(txt)):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions