We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b0c52b2 commit ef95538Copy full SHA for ef95538
xarray/core/dataset.py
@@ -2994,8 +2994,7 @@ def isel(
2994
# without any relevant dimensions for slicing.
2995
# Pick those out quickly and avoid paying the cost below
2996
# of resolving the var_indexers variables
2997
- var_indexer_keys = all_keys.intersection(var_dims)
2998
- if var_indexer_keys:
+ if var_indexer_keys := all_keys.intersection(var_dims):
2999
var_indexers = {k: indexers[k] for k in var_indexer_keys}
3000
var = var.isel(var_indexers)
3001
if drop and var.ndim == 0 and name in coord_names:
0 commit comments