From 07de257c5884df49335496ee6347fb633a7c302c Mon Sep 17 00:00:00 2001 From: Illviljan <14371165+Illviljan@users.noreply.github.com> Date: Mon, 11 Oct 2021 08:16:04 +0200 Subject: [PATCH] Simplify transpose in xr.dot (#5849) --- xarray/core/computation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xarray/core/computation.py b/xarray/core/computation.py index bbaae1f5b36..7f60da7e1b2 100644 --- a/xarray/core/computation.py +++ b/xarray/core/computation.py @@ -1529,7 +1529,7 @@ def dot(*arrays, dims=None, **kwargs): join=join, dask="allowed", ) - return result.transpose(*[d for d in all_dims if d in result.dims]) + return result.transpose(*all_dims, missing_dims="ignore") def where(cond, x, y):