Replies: 1 comment
-
Please could you add a copy-pasteable example? |
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.
-
I am coming up short with xarrray. Maybe it can't do what I want, but I suspect my problem is me not understanding how to index/select dimensions/axes.
I have data that have dimensions lat, long and time. Just like the tutorial data. I would like to:
This I can get for one time step by using numpy's np.sort by selection time for the xarray dataarray.values. To do for all time steps, I need a loop.
Is there not functionality akin to how .sum works, where it - because it sums all elements - of course only return an dataarray with dimension and size of the time coordinate? If I just write the exact same, I get a returned array that still has a lat-lon matrix for each time, though it is cumsummed (by what axis order I do not know).
Regarding sortby I have tried many things too, but I don't know how to tell it to sort by the values of the lat-lon matrix for each time step.
The example in the docs sort by the array's own values (like I want) but it a 1D array with only time dimension.
What key thing am I missing here ...?
Beta Was this translation helpful? Give feedback.
All reactions