如何解决如何在python中使用xarray乘以气候数据集?
输入:
tws = ds1.lwe_thickness
print(tws.size)
print(tws.shape)
# tws
# vectorization
stacked1 = tws.stack(space =("latitude","longitude")) #
stacked
print(stacked1.shape)
# standardization
Y = (stacked1-stacked1.mean())/(stacked1.std())
print(Y)
print(Y.shape)
print(Xt.shape) # precipitation dataset
print(Y.shape) # total water storage dataset
# co-variance between precipitation and total water storage
Cxy = (Xt*Y)/(72)
print(Cxy.shape)
print(Cxy)
print(Cxy.dims)
输出:
(64800,72) (72,64800) (64800,0)
- 纬度(空间) float64 -90.0 -90.0 -90.0 -90.0 ... 89.0 89.0 89.0 89.0
- 经度(空间) float64 0.0 1.0 2.0 3.0 4.0 ... 356.0 357.0 358.0 359.0('空间','时间')
最初 Xt 矩阵的大小为 6480072,Y 为 7264800。将这两个矩阵相乘后,大小应为 6480064800,但我得到 648000。为什么会发生这种情况?帮我解决这个问题。基本上我在这里使用 xarray。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。