How to decrease a dimension and drop corresponding variables' elements? #8131
-
Let's say I have a DataSet with following info. Now for dim1=10, I want to delete the following elements for both var1 and var2, [2, 5, 6], that is, to delete var1[2], var1[5], var1[6], var2[2, :], var2[5, :], var2[6, :], and reduce the dim1 to 10 - 3 = 7, what are the most appropriate ways to do this with xarray? First set these to-be-deleted elements to nan and then drop these nan elements? Does DataSet provide such functions? Above is a simplified example. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I just figured it out, use DataSet.drop_isel() would work. |
Beta Was this translation helpful? Give feedback.
I just figured it out, use DataSet.drop_isel() would work.