We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c017481 commit d1f47d5Copy full SHA for d1f47d5
xarray/tests/test_dataarray.py
@@ -2582,6 +2582,15 @@ def change_metadata(x):
2582
expected = change_metadata(expected)
2583
assert_equal(expected, actual)
2584
2585
+ def test_groupby_reduce_dimension_error(self):
2586
+ array = self.make_groupby_example_array()
2587
+ grouped = array.groupby("y")
2588
+ with raises_regex(ValueError, "cannot reduce over dimension 'y'"):
2589
+ grouped.mean()
2590
+
2591
+ grouped = array.groupby("y", squeeze=False)
2592
+ assert_identical(array, grouped.mean())
2593
2594
def test_groupby_math(self):
2595
array = self.make_groupby_example_array()
2596
for squeeze in [True, False]:
0 commit comments