Skip to content

Commit

Permalink
Document drop_variables in open_mfdataset (#8083)
Browse files Browse the repository at this point in the history
* Document drop_variables in open_mfdataset

* Document open_mfdataset drop_variables option in example

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Spelling

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tom Nicholas <[email protected]>
  • Loading branch information
3 people authored Aug 31, 2023
1 parent 0f9f790 commit 1043a9e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion xarray/backends/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,9 @@ def open_mfdataset(
If a callable, it must expect a sequence of ``attrs`` dicts and a context object
as its only parameters.
**kwargs : optional
Additional arguments passed on to :py:func:`xarray.open_dataset`.
Additional arguments passed on to :py:func:`xarray.open_dataset`. For an
overview of some of the possible options, see the documentation of
:py:func:`xarray.open_dataset`
Returns
-------
Expand Down Expand Up @@ -965,6 +967,13 @@ def open_mfdataset(
... "file_*.nc", concat_dim="time", preprocess=partial_func
... ) # doctest: +SKIP
It is also possible to use any argument to ``open_dataset`` together
with ``open_mfdataset``, such as for example ``drop_variables``:
>>> ds = xr.open_mfdataset(
... "file.nc", drop_variables=["varname_1", "varname_2"] # any list of vars
... ) # doctest: +SKIP
References
----------
Expand Down

0 comments on commit 1043a9e

Please sign in to comment.