Replies: 2 comments 1 reply
-
Do you remember the function you used? E.g. the following works air = xr.tutorial.load_dataset("air_temperature")
air.map(lambda x: 1) |
Beta Was this translation helpful? Give feedback.
1 reply
-
@keewis is correct, this is using the result of |
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.
-
The user documentation doesn't really give much information on what kind of functions you can use with
map()
, it seems like it only covers numpy ufuncs or compositions of them. The example of using a custom function is:which will return a
DataArray
forDataArray
input. The documentation doesn't explicitly state that this is required, but when I try to use it with a function that returns a scalar I get:Wrapping the return value in a zero-dimensional
DataArray
fixes the issue. Is this the expected behavior?Beta Was this translation helpful? Give feedback.
All reactions