From 3013fb495785e0d5d559a597fe55cde6c77e85e0 Mon Sep 17 00:00:00 2001 From: Tom Nicholas Date: Thu, 18 Jul 2024 05:53:12 -0400 Subject: [PATCH] Update dropna docstring (#9257) Co-authored-by: Deepak Cherian --- xarray/core/dataset.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py index 0540744739a..3e9ca1287e5 100644 --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -6371,7 +6371,7 @@ def dropna( Data variables: temperature (time, location) float64 64B 23.4 24.1 nan ... 24.2 20.5 25.3 - # Drop NaN values from the dataset + Drop NaN values from the dataset >>> dataset.dropna(dim="time") Size: 80B @@ -6382,7 +6382,7 @@ def dropna( Data variables: temperature (time, location) float64 48B 23.4 24.1 21.8 24.2 20.5 25.3 - # Drop labels with any NAN values + Drop labels with any NaN values >>> dataset.dropna(dim="time", how="any") Size: 80B @@ -6393,7 +6393,7 @@ def dropna( Data variables: temperature (time, location) float64 48B 23.4 24.1 21.8 24.2 20.5 25.3 - # Drop labels with all NAN values + Drop labels with all NAN values >>> dataset.dropna(dim="time", how="all") Size: 104B @@ -6404,7 +6404,7 @@ def dropna( Data variables: temperature (time, location) float64 64B 23.4 24.1 nan ... 24.2 20.5 25.3 - # Drop labels with less than 2 non-NA values + Drop labels with less than 2 non-NA values >>> dataset.dropna(dim="time", thresh=2) Size: 80B @@ -6418,6 +6418,11 @@ def dropna( Returns ------- Dataset + + See Also + -------- + DataArray.dropna + pandas.DataFrame.dropna """ # TODO: consider supporting multiple dimensions? Or not, given that # there are some ugly edge cases, e.g., pandas's dropna differs