From d238459ae2bbe2a38f855e12ca4752c2fd28051c Mon Sep 17 00:00:00 2001 From: dcherian Date: Fri, 5 Nov 2021 21:50:30 -0600 Subject: [PATCH] any,all --- ci/requirements/environment-windows.yml | 2 +- ci/requirements/environment.yml | 2 +- xarray/core/_reductions.py | 40 +++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 2 deletions(-) diff --git a/ci/requirements/environment-windows.yml b/ci/requirements/environment-windows.yml index 1f4302c0d4b..c65557e5803 100644 --- a/ci/requirements/environment-windows.yml +++ b/ci/requirements/environment-windows.yml @@ -44,4 +44,4 @@ dependencies: - pip: - numbagg - numpy_groupies - - dask_groupby + - git+https://github.com:dcherian/dask_groupby.git diff --git a/ci/requirements/environment.yml b/ci/requirements/environment.yml index ee25a48e5fc..cd88d26c8c6 100644 --- a/ci/requirements/environment.yml +++ b/ci/requirements/environment.yml @@ -48,4 +48,4 @@ dependencies: - pip: - numbagg - numpy_groupies - - dask_groupby + - git+https://github.com:dcherian/dask_groupby.git diff --git a/xarray/core/_reductions.py b/xarray/core/_reductions.py index 2f61ff04b8e..b221038da61 100644 --- a/xarray/core/_reductions.py +++ b/xarray/core/_reductions.py @@ -171,6 +171,12 @@ def all( da (time) bool True True True True True False >>> ds.groupby("labels").all() + + Dimensions: (labels: 3) + Coordinates: + * labels (labels) object 'a' 'b' 'c' + Data variables: + da (labels) bool False True True See Also -------- @@ -249,6 +255,12 @@ def any( da (time) bool True True True True True False >>> ds.groupby("labels").any() + + Dimensions: (labels: 3) + Coordinates: + * labels (labels) object 'a' 'b' 'c' + Data variables: + da (labels) bool True True True See Also -------- @@ -1167,6 +1179,12 @@ def all( da (time) bool True True True True True False >>> ds.resample(time="3M").all() + + Dimensions: (time: 3) + Coordinates: + * time (time) datetime64[ns] 2001-01-31 2001-04-30 2001-07-31 + Data variables: + da (time) bool True True False See Also -------- @@ -1245,6 +1263,12 @@ def any( da (time) bool True True True True True False >>> ds.resample(time="3M").any() + + Dimensions: (time: 3) + Coordinates: + * time (time) datetime64[ns] 2001-01-31 2001-04-30 2001-07-31 + Data variables: + da (time) bool True True True See Also -------- @@ -2167,6 +2191,10 @@ def all( labels (time) >> da.groupby("labels").all() + + array([False, True, True]) + Coordinates: + * labels (labels) object 'a' 'b' 'c' See Also -------- @@ -2241,6 +2269,10 @@ def any( labels (time) >> da.groupby("labels").any() + + array([ True, True, True]) + Coordinates: + * labels (labels) object 'a' 'b' 'c' See Also -------- @@ -3089,6 +3121,10 @@ def all( labels (time) >> da.resample(time="3M").all() + + array([ True, True, False]) + Coordinates: + * time (time) datetime64[ns] 2001-01-31 2001-04-30 2001-07-31 See Also -------- @@ -3163,6 +3199,10 @@ def any( labels (time) >> da.resample(time="3M").any() + + array([ True, True, True]) + Coordinates: + * time (time) datetime64[ns] 2001-01-31 2001-04-30 2001-07-31 See Also --------