Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalize pr.set #237

Open
mikapfl opened this issue Jun 3, 2024 · 1 comment
Open

Generalize pr.set #237

mikapfl opened this issue Jun 3, 2024 · 1 comment

Comments

@mikapfl
Copy link
Member

mikapfl commented Jun 3, 2024

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 of dim and key, have a sel, so that it looks like da.pr.set(sel, value).
  • Support scalar NaN value in ds.set.
@mikapfl
Copy link
Member Author

mikapfl commented Jun 3, 2024

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant