Skip to content
forked from pydata/xarray

Commit

Permalink
Add NaTs
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian committed Oct 17, 2019
1 parent 5bf94a8 commit 71df146
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions xarray/tests/test_groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,19 @@ def test_groupby_drops_nans():
actual = array.groupby("x1").sum()
assert_equal(expected, actual)

# NaT in non-dimensional coordinate
array["t"] = (
"x",
[
np.datetime64("2001-01-01"),
np.datetime64("2001-01-01"),
np.datetime64("NaT"),
],
)
expected = xr.DataArray(3, [("t", [np.datetime64("2001-01-01")])])
actual = array.groupby("t").sum()
assert_equal(expected, actual)

# test for repeated coordinate labels
array = xr.DataArray([0, 1, 2, 4, 3, 4], [("x", [np.nan, 1, 1, np.nan, 2, np.nan])])
expected = xr.DataArray([3, 3], [("x", [1, 2])])
Expand Down

0 comments on commit 71df146

Please sign in to comment.