Skip to content

How to apply function which based on DataArrays of Dataset? #6428

Answered by dcherian
zxdawn asked this question in Q&A
Discussion options

You must be logged in to vote

IIUC you want something like

xr.apply_ufunc(
    integrate_at_single_x_y,
	ds.top,
	ds.middle,
	vectorize=True, # does the for loop for you
)

Neither x or y are a core dimension here, because the lowest-dimensional input your function requires is a scalar.

Replies: 1 comment 1 reply

Comment options

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

Answer selected by zxdawn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants