Skip to content

Commit

Permalink
avoid modifying the values of a pandas series
Browse files Browse the repository at this point in the history
  • Loading branch information
keewis committed Apr 13, 2024
1 parent 4bf840c commit a094d25
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions xarray/tests/test_missing.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,10 @@ def test_interpolate_pd_compat_non_uniform_index():
# for the linear methods. This next line inforces the xarray
# fill_value convention on the pandas output. Therefore, this test
# only checks that interpolated values are the same (not nans)
expected.values[pd.isnull(actual.values)] = np.nan
expected_values = expected.values.copy()
expected_values[pd.isnull(actual.values)] = np.nan

np.testing.assert_allclose(actual.values, expected.values)
np.testing.assert_allclose(actual.values, expected_values)


@requires_scipy
Expand Down

0 comments on commit a094d25

Please sign in to comment.