forked from pydata/xarray
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug fixes for Dataset.reduce() and n-dimensional cumsum/cumprod (pyda…
…ta#2156) * Bug fixes for Dataset.reduce() and n-dimensional cumsum/cumprod Fixes GH1470, "Dataset.mean drops coordinates" Fixes a bug where non-scalar data-variables that did not include the aggregated dimension were not properly reduced: Previously:: >>> ds = Dataset({'x': ('a', [2, 2]), 'y': 2, 'z': ('b', [2])}) >>> ds.var('a') <xarray.Dataset> Dimensions: (b: 1) Dimensions without coordinates: b Data variables: x float64 0.0 y float64 0.0 z (b) int64 2 Now:: >>> ds.var('a') <xarray.Dataset> Dimensions: (b: 1) Dimensions without coordinates: b Data variables: x int64 0 y int64 0 z (b) int64 0 Finally, adds support for n-dimensional cumsum() and cumprod(), reducing over all dimensions of an array. (This was necessary as part of the above fix.) * Lint fixup * remove confusing comments
- Loading branch information
Showing
7 changed files
with
140 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters