Union of two arrays. The output is always a masked array. See `numpy.union1d` for more details. See Also -------- numpy.union1d : Equivalent function for ndarrays. Examples -------- >>> import numpy as np >>> ar1 = np.ma.array([1, 2, 3, 4]) >>> ar2 = np.ma
(ar1, ar2)
| 1461 | |
| 1462 | |
| 1463 | def union1d(ar1, ar2): |
| 1464 | """ |
| 1465 | Union of two arrays. |
| 1466 | |
| 1467 | The output is always a masked array. See `numpy.union1d` for more details. |
| 1468 | |
| 1469 | See Also |
| 1470 | -------- |
| 1471 | numpy.union1d : Equivalent function for ndarrays. |
| 1472 | |
| 1473 | Examples |
| 1474 | -------- |
| 1475 | >>> import numpy as np |
| 1476 | >>> ar1 = np.ma.array([1, 2, 3, 4]) |
| 1477 | >>> ar2 = np.ma.array([3, 4, 5, 6]) |
| 1478 | >>> np.ma.union1d(ar1, ar2) |
| 1479 | masked_array(data=[1, 2, 3, 4, 5, 6], |
| 1480 | mask=False, |
| 1481 | fill_value=999999) |
| 1482 | |
| 1483 | """ |
| 1484 | return unique(ma.concatenate((ar1, ar2), axis=None)) |
| 1485 | |
| 1486 | |
| 1487 | def setdiff1d(ar1, ar2, assume_unique=False): |
searching dependent graphs…