Commit 5caf4c9
committed
BUG: Make median work for empty arrays (issue numpy#6462)
np.median([]) returns NaN. Fixes bug/regression that raised an IndexError.
Added tests to ensure continued support of empty arrays.1 parent 17146b2 commit 5caf4c9
2 files changed
+29
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3339 | 3339 | | |
3340 | 3340 | | |
3341 | 3341 | | |
3342 | | - | |
| 3342 | + | |
3343 | 3343 | | |
3344 | 3344 | | |
3345 | 3345 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2597 | 2597 | | |
2598 | 2598 | | |
2599 | 2599 | | |
| 2600 | + | |
| 2601 | + | |
| 2602 | + | |
| 2603 | + | |
| 2604 | + | |
| 2605 | + | |
| 2606 | + | |
| 2607 | + | |
| 2608 | + | |
| 2609 | + | |
| 2610 | + | |
| 2611 | + | |
| 2612 | + | |
| 2613 | + | |
| 2614 | + | |
| 2615 | + | |
| 2616 | + | |
| 2617 | + | |
| 2618 | + | |
| 2619 | + | |
| 2620 | + | |
| 2621 | + | |
| 2622 | + | |
| 2623 | + | |
| 2624 | + | |
| 2625 | + | |
| 2626 | + | |
| 2627 | + | |
2600 | 2628 | | |
2601 | 2629 | | |
2602 | 2630 | | |
| |||
0 commit comments