-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Feature request: How Do I add a new variable to a data set? #3678
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
Comments
A pull request would be very welcome! |
OK, done. Per my comments, I don't have the ability to build and check the sphinx code, so please check before merging. |
@dcherian
...is all I have come up with and this gets bloated and unreadable really quickly if there are multiple conjuncts. Infix conjunction seems not to work unless I take the I figure this is something that lots of people will want to do, but it seems a lot harder than |
You can shorthen this using parantheses and sel = (other_data_array['bar'] == 12) & (other_data_array['baz'] < 22)
foo = data_array.where(sel) |
@mathause Thank you! That never occurred to me. I thought it was something wrong with the way I was using conjunction, but now I believe it was just a matter of operator precedence. |
A common thing to want to do is to create a new
DataArray
and add it to an existingDataset
, but the answer does not seem to appear in the "How Do I?" list.Thanks!
The text was updated successfully, but these errors were encountered: