我的DataArray太大,无法转换为NumPy数组:
da = xr.open_dataset('tprate.grib', engine='cfgrib').tprate
da.values
我得到:
Unable to allocate 8.56 TiB for an array with shape (28, 7008, 185, 180, 360) and data type float32
如果Iisel
是DataArray的前两个维度的一部分,则它能够转换:
ncep_da.isel(number=0, time=0).values
但如果Iisel
最后两个维度,使用的内存保持不变:
ncep_da.isel(latitude=0, longitude=0).values
我仍然得到:
Unable to allocate 8.56 TiB for an array with shape (28, 7008, 185, 180, 360) and data type float32
我猜这是因为第二个子数组没有顺序存储在磁盘上,因为最右边的维度是数据的内环
有没有办法提取第二个子数组并将其高效地转换为NumPy数组
目前没有回答
相关问题 更多 >
编程相关推荐