Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion xarray/core/duck_array_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ def sum_where(data, axis=None, dtype=None, where=None):
def where(condition, x, y):
"""Three argument where() with better dtype promotion rules."""
xp = get_array_namespace(condition, x, y)
return xp.where(condition, *as_shared_dtype([x, y], xp=xp))
return xp.where(xp.astype(condition, xp.bool), *as_shared_dtype([x, y], xp=xp))
Comment thread
keewis marked this conversation as resolved.
Outdated


def where_method(data, cond, other=dtypes.NA):
Expand Down