Skip to content

Commit 38b0144

Browse files
rpgoldmanmax-sixtydcherian
authored
Clarify drop_vars return value. (#4244)
* Clarify drop_vars return value. The previous documentation was not clear about whether the variable dropping was "inplace" or created a fresh Dataset. * Update xarray/core/dataarray.py Fix syntax error in docstring markdown. Co-authored-by: Maximilian Roos <[email protected]> * Update xarray/core/dataarray.py Co-authored-by: Maximilian Roos <[email protected]> Co-authored-by: Robert P. Goldman <[email protected]> Co-authored-by: Maximilian Roos <[email protected]> Co-authored-by: Deepak Cherian <[email protected]> Co-authored-by: dcherian <[email protected]>
1 parent 1f45bca commit 38b0144

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

xarray/core/dataarray.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2012,7 +2012,7 @@ def T(self) -> "DataArray":
20122012
def drop_vars(
20132013
self, names: Union[Hashable, Iterable[Hashable]], *, errors: str = "raise"
20142014
) -> "DataArray":
2015-
"""Drop variables from this DataArray.
2015+
"""Returns an array with dropped variables.
20162016
20172017
Parameters
20182018
----------
@@ -2026,7 +2026,7 @@ def drop_vars(
20262026
Returns
20272027
-------
20282028
dropped : Dataset
2029-
2029+
New Dataset copied from `self` with variables removed.
20302030
"""
20312031
ds = self._to_temp_dataset().drop_vars(names, errors=errors)
20322032
return self._from_temp_dataset(ds)

0 commit comments

Comments
 (0)