Skip to content Skip to sidebar Skip to footer

Incorrect Shape Of Array After Xarray Multiplication Operation

As per Value error in multplying xarray variable with 2D numpy array import xarray as xr hndl_tran = xr.open_dataset(path_netcdf, chunks={'time': 10}) flow_data = hndl_tran['val']

Solution 1:

xarray aligns the shapes based on the dimensions of the array. So if the dimensions don't share names, the multiplication is going to create a union of all dimensions.

I imagine flow_data and vba have differently named dimensions - use .rename to set matching dimensions to matching names

Post a Comment for "Incorrect Shape Of Array After Xarray Multiplication Operation"