Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opposite of drop_variables option in open_dataset() #1754

Open
bartvstratum opened this issue Dec 1, 2017 · 3 comments · May be fixed by #8450
Open

Opposite of drop_variables option in open_dataset() #1754

bartvstratum opened this issue Dec 1, 2017 · 3 comments · May be fixed by #8450

Comments

@bartvstratum
Copy link

Not so much an issue but more a feature request. xarray.open_dataset() has the drop_variables option, perhaps the opposite could also be useful, e.g. include_variables or read_variables (i.e.; only read the variables which are listed and ignore the others).

I often work with large NetCDF files (>100 variables) out of which I only want to read a few; it is easier to list those few variables than to create a list with the hundred(s) of variables which I don't want.

@snowman2
Copy link
Contributor

I second this request. I have had this same need before where I don't always know what variables I don't want, but I do know the variables that I do want.

@shoyer
Copy link
Member

shoyer commented Dec 14, 2017

I'm reluctant to add yet another keyword argument to open_dataset, but we're started refactoring xarray's internal system for decoding metadata netCDF files (#1752), and with any luck that would provide a natural way to custom this.

@stale
Copy link

stale bot commented Nov 14, 2019

In order to maintain a list of currently relevant issues, we mark issues as stale after a period of inactivity

If this issue remains relevant, please comment here or remove the stale label; otherwise it will be marked as closed automatically

@stale stale bot added the stale label Nov 14, 2019
@dcherian dcherian removed the stale label Nov 14, 2019
@claytharrison claytharrison linked a pull request Nov 14, 2023 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants