如何在python中使用xarray增加气候数据集?

如何在python中使用xarray增加气候数据集?,python,matrix-multiplication,python-xarray,code-climate,Python,Matrix Multiplication,Python Xarray,Code Climate,输入: 输出: (64800,72)(7264800)(64800,0)数组([],形状=(64800,0),数据类型=浮点64)坐标:* 时间(时间)日期时间64[ns]*空间(空间)多索引 纬度(空间)浮动64-90.0-90.0-90.0-90.0。。。89.089.089.089.0 经度(空间)浮动64 0.0 1.0 2.0 3.0 4.0。。。356.0 357.0 358.0 359.0(‘空间’、‘时间’) 最初,Xt矩阵的大小为6480072,Y为7264800。这两个矩

输入:

输出:

(64800,72)(7264800)(64800,0)数组([],形状=(64800,0),数据类型=浮点64)坐标:* 时间(时间)日期时间64[ns]*空间(空间)多索引

  • 纬度(空间)浮动64-90.0-90.0-90.0-90.0。。。89.089.089.089.0
  • 经度(空间)浮动64 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

图像已附加

Try
Cxy=(Xt@Y)/(72)
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)