Skip to content

Is there a way to handle concatenating dataset if data_vars differ? #4586

Answered by keewis
ahuang11 asked this question in Q&A
Discussion options

You must be logged in to vote

Unfortunately, the documentation of the data_vars parameter is a bit unclear, so we need to look at the code to know its purpose. The variables to be concatenated are calculated in _calc_concat_over (which could use some refactoring, by the way):

def _calc_concat_over(datasets, dim, dim_names, data_vars, coords, compat):
"""
Determine which dataset variables need to be concatenated in the result,
"""
# Return values
concat_over = set()
equals = {}
if dim in dim_names:
concat_over_existing_dim = True
concat_over.add(dim)
else:
concat_over_existing_dim = False

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@ahuang11
Comment options

Answer selected by ahuang11
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants