Return the common filling value of two masked arrays, if any. If ``a.fill_value == b.fill_value``, return the fill value, otherwise return None. Parameters ---------- a, b : MaskedArray The masked arrays for which to compare fill values. Returns -------
(a, b)
| 553 | |
| 554 | |
| 555 | def common_fill_value(a, b): |
| 556 | """ |
| 557 | Return the common filling value of two masked arrays, if any. |
| 558 | |
| 559 | If ``a.fill_value == b.fill_value``, return the fill value, |
| 560 | otherwise return None. |
| 561 | |
| 562 | Parameters |
| 563 | ---------- |
| 564 | a, b : MaskedArray |
| 565 | The masked arrays for which to compare fill values. |
| 566 | |
| 567 | Returns |
| 568 | ------- |
| 569 | fill_value : scalar or None |
| 570 | The common fill value, or None. |
| 571 | |
| 572 | Examples |
| 573 | -------- |
| 574 | >>> x = np.ma.array([0, 1.], fill_value=3) |
| 575 | >>> y = np.ma.array([0, 1.], fill_value=3) |
| 576 | >>> np.ma.common_fill_value(x, y) |
| 577 | 3.0 |
| 578 | |
| 579 | """ |
| 580 | t1 = get_fill_value(a) |
| 581 | t2 = get_fill_value(b) |
| 582 | if t1 == t2: |
| 583 | return t1 |
| 584 | return None |
| 585 | |
| 586 | |
| 587 | def filled(a, fill_value=None): |
nothing calls this directly
no test coverage detected