Find the set difference of two index arrays. Return the unique values in ar1 that are not in ar2. Parameters ---------- ar1: utils.Index Input index array. ar2: utils.Index Input comparison index array. Returns ------- setdiff: Array of valu
(ar1, ar2)
| 318 | |
| 319 | |
| 320 | def set_diff(ar1, ar2): |
| 321 | """Find the set difference of two index arrays. |
| 322 | Return the unique values in ar1 that are not in ar2. |
| 323 | |
| 324 | Parameters |
| 325 | ---------- |
| 326 | ar1: utils.Index |
| 327 | Input index array. |
| 328 | |
| 329 | ar2: utils.Index |
| 330 | Input comparison index array. |
| 331 | |
| 332 | Returns |
| 333 | ------- |
| 334 | setdiff: |
| 335 | Array of values in ar1 that are not in ar2. |
| 336 | """ |
| 337 | ar1_np = ar1.tonumpy() |
| 338 | ar2_np = ar2.tonumpy() |
| 339 | setdiff = np.setdiff1d(ar1_np, ar2_np) |
| 340 | setdiff = toindex(setdiff) |
| 341 | return setdiff |
| 342 | |
| 343 | |
| 344 | class LazyDict(Mapping): |