From 579bc17f0fe076701840ea72daaeded51f011d87 Mon Sep 17 00:00:00 2001 From: Tien Vo Date: Mon, 14 Oct 2024 09:48:36 -0600 Subject: [PATCH] Use keyword argument for nan=0 (#300) --- fundamentals/03.1_computation_with_xarray.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fundamentals/03.1_computation_with_xarray.ipynb b/fundamentals/03.1_computation_with_xarray.ipynb index 9dbaadd0..b72d93e9 100644 --- a/fundamentals/03.1_computation_with_xarray.ipynb +++ b/fundamentals/03.1_computation_with_xarray.ipynb @@ -149,7 +149,7 @@ }, "outputs": [], "source": [ - "np.nan_to_num(ds.sst, 0)" + "np.nan_to_num(ds.sst, nan=0)" ] }, { @@ -167,7 +167,7 @@ "metadata": {}, "outputs": [], "source": [ - "xr.apply_ufunc(np.nan_to_num, ds.sst, 0)" + "xr.apply_ufunc(np.nan_to_num, ds.sst, kwargs={\"nan\": 0})" ] }, {