Efficient way of combining xarray datasets (explode + combine_by_coords) with variables only sharing subset of coordinates #6029
Unanswered
adrien-perello
asked this question in
Q&A
Replies: 2 comments 4 replies
-
Coordinates can be any number of dimensions! Can you give more detail if that doesn't answer your question, ref #5404 |
Beta Was this translation helpful? Give feedback.
4 replies
-
using |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
(message edited for clarity)
Context
I'm running a simulation that generates multiple (networkx) graphs. (It's actually a mesa agent-based simulation inspired from the Virus on a Network example) and due to randomness, I run each set of parameters multiple times.
Minimal example
The following example hopefully gives an idea of what I'm trying to achieve
Which gives
Goal
infected
anddegree distribution
(!! note:infected
has a fixed length (=nb_steps
) but notdegree distribution
(whose length varies)).Current solution
I use the following helper function to explode the different columns
which I use as follow:
Result
Limits
It works, but it is quite slow and really inelegant.
--> What would be a better way of handling it?
Beta Was this translation helpful? Give feedback.
All reactions