Skip to content

Commit 1043a9e

Browse files
jerabaul29pre-commit-ci[bot]TomNicholas
authored
Document drop_variables in open_mfdataset (#8083)
* 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 <thomas.nicholas@columbia.edu>
1 parent 0f9f790 commit 1043a9e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

xarray/backends/api.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,9 @@ def open_mfdataset(
930930
If a callable, it must expect a sequence of ``attrs`` dicts and a context object
931931
as its only parameters.
932932
**kwargs : optional
933-
Additional arguments passed on to :py:func:`xarray.open_dataset`.
933+
Additional arguments passed on to :py:func:`xarray.open_dataset`. For an
934+
overview of some of the possible options, see the documentation of
935+
:py:func:`xarray.open_dataset`
934936
935937
Returns
936938
-------
@@ -965,6 +967,13 @@ def open_mfdataset(
965967
... "file_*.nc", concat_dim="time", preprocess=partial_func
966968
... ) # doctest: +SKIP
967969
970+
It is also possible to use any argument to ``open_dataset`` together
971+
with ``open_mfdataset``, such as for example ``drop_variables``:
972+
973+
>>> ds = xr.open_mfdataset(
974+
... "file.nc", drop_variables=["varname_1", "varname_2"] # any list of vars
975+
... ) # doctest: +SKIP
976+
968977
References
969978
----------
970979

0 commit comments

Comments
 (0)