numpy.lib.format.read_array_header_2_0#
- lib.format.read_array_header_2_0(fp, max_header_size=10000)[源代码]#
使用 2.0 文件格式版本从类文件对象中读取数组头.
这将使文件对象位于 header 之后.
- 参数:
- fpfilelike object
文件对象或具有 read() 方法的对象,例如文件.
- max_header_size整数,可选
header 允许的最大大小. 大型 header 可能无法安全加载,因此需要显式传递更大的值. 有关详细信息,请参见
ast.literal_eval.
- 返回:
- shapetuple of int
数组的形状.
- fortran_orderbool
如果数组是 C 连续的或 Fortran 连续的,则数组数据将直接写出. 否则,在写出之前,它将变为连续的.
- dtypedtype
文件数据的数据类型.
- 提出:
- ValueError
如果数据无效.