CMIP6 nc 文件按时间、经纬度分割导入相关包1import xarray as xr 分割 可以单独进行按时间分割和按经纬度分割。 1234567891011nc = xr.open_dataset( r'D:\WorkSpace\Python_WorkSpace\CMIP_Test\Data\pr_day_BCC-CSM2-MR_ssp126_r1i1p1f1_gn_20150101-20391231.nc')v = nc['pr']print(v)for year in range(2015, 2040): time = v.loc[str(year) + '-01-01 00:00:00':str(year + 1) + '-01-01 00:00:00'] latlon = time.loc[:, 15:60, 70:140] # 最小纬度:最大纬度,最小经度:最大经度 ds = xr.Dataset({'pr': latlon}) # ds = xr.Dataset({"pr": time}) ds.to_netcdf('D:\WorkSpace\Python_WorkSpace\CMIP_Test\CMIP6\pr_China\pr_China_' + str(year) + '.nc') # 输出路径 print(str(year) + 'success') 参考链接https://blog.csdn.net/asdtf123/article/details/122141105