Generalize `pr.set`
Opened this issue · 1 comments
mikapfl commented
Is your feature request related to a problem? Please describe.
Xarray lacks an easy-to-use solution for setting specific values. Unfortunately, pr.set
also doesn't handle all use cases so far.
Describe the solution you'd like
It would be great to handle the following cases:
- Like combine_first, but preserving NaNs in early objects before alignment.
- Like
set
, but instead ofdim
andkey
, have asel
, so that it looks likeda.pr.set(sel, value)
. - Support scalar NaN value in
ds.set
.
mikapfl commented
@JGuetschow Other use cases you'd like solved?
I can't promise that it is actually possible to solve everything here (I think there was a reason to only support dim
and key
, not the full sel
) but given that we again and again deal with this, we should consider some use cases we really need.