Commit 128ee17
committed
Remove/rework uses of np.where where possible.
In a few places, np.where can be replaced by direct use of boolean
arrays, or other constructs.
In colors.py, the use of putmask may be slightly obscure (so I left a
comment explaining it), but avoids repeating the modified array twice,
so I think is more legible.
In polar.py, preallocating xy is just pointless given that we're
constructing intermediate arrays for x and y and filling them into xy
afterwards.1 parent 72cad98 commit 128ee17Copy full SHA for 128ee17
File tree
Expand file treeCollapse file tree
6 files changed
+24
-48
lines changedOpen diff view settings
Filter options
- examples
- images_contours_and_fields
- mplot3d
- lib/matplotlib
- projections
- tri
Expand file treeCollapse file tree
6 files changed
+24
-48
lines changedOpen diff view settings
Collapse file
examples/images_contours_and_fields/barcode_demo.py
Copy file name to clipboardExpand all lines: examples/images_contours_and_fields/barcode_demo.py+2-4Lines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
11 | 11 | |
12 | 12 | |
13 | 13 | |
14 | | - |
15 | 14 | |
16 | | - |
| 15 | + |
17 | 16 | |
18 | 17 | |
19 | | - |
| 18 | + |
20 | 19 | |
21 | 20 | |
22 | 21 | |
| ||
28 | 27 | |
29 | 28 | |
30 | 29 | |
31 | | - |
32 | 30 | |
33 | 31 | |
34 | 32 | |
|
Collapse file
examples/images_contours_and_fields/specgram_demo.py
Copy file name to clipboardExpand all lines: examples/images_contours_and_fields/specgram_demo.py+2-4Lines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
3 | 3 | |
4 | 4 | |
5 | 5 | |
6 | | - |
7 | | - |
| 6 | + |
8 | 7 | |
9 | 8 | |
10 | 9 | |
| ||
18 | 17 | |
19 | 18 | |
20 | 19 | |
21 | | - |
22 | | - |
| 20 | + |
23 | 21 | |
24 | 22 | |
25 | 23 | |
|
Collapse file
examples/mplot3d/trisurf3d_2.py
Copy file name to clipboardExpand all lines: examples/mplot3d/trisurf3d_2.py+3-3Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1 | | - |
| 1 | + |
2 | 2 | |
3 | 3 | |
4 | 4 | |
| ||
8 | 8 | |
9 | 9 | |
10 | 10 | |
11 | | - |
| 11 | + |
12 | 12 | |
13 | 13 | |
14 | 14 | |
| ||
71 | 71 | |
72 | 72 | |
73 | 73 | |
74 | | - |
| 74 | + |
75 | 75 | |
76 | 76 | |
77 | 77 | |
|
Collapse file
+13-22Lines changed: 13 additions & 22 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1775 | 1775 | |
1776 | 1776 | |
1777 | 1777 | |
1778 | | - |
1779 | | - |
1780 | | - |
1781 | | - |
1782 | | - |
1783 | | - |
1784 | | - |
1785 | | - |
1786 | | - |
1787 | | - |
1788 | | - |
1789 | | - |
1790 | | - |
1791 | | - |
1792 | | - |
1793 | | - |
1794 | | - |
1795 | | - |
1796 | | - |
1797 | | - |
1798 | | - |
1799 | | - |
| 1778 | + |
| 1779 | + |
| 1780 | + |
| 1781 | + |
| 1782 | + |
| 1783 | + |
| 1784 | + |
| 1785 | + |
| 1786 | + |
| 1787 | + |
| 1788 | + |
| 1789 | + |
| 1790 | + |
1800 | 1791 | |
1801 | 1792 | |
1802 | 1793 | |
|
Collapse file
lib/matplotlib/projections/polar.py
Copy file name to clipboardExpand all lines: lib/matplotlib/projections/polar.py+3-14Lines changed: 3 additions & 14 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
44 | 44 | |
45 | 45 | |
46 | 46 | |
47 | | - |
48 | | - |
49 | | - |
50 | | - |
51 | | - |
52 | | - |
53 | | - |
| 47 | + |
54 | 48 | |
55 | 49 | |
56 | 50 | |
57 | 51 | |
58 | 52 | |
59 | | - |
60 | 53 | |
61 | 54 | |
62 | | - |
63 | | - |
64 | | - |
65 | | - |
66 | | - |
67 | | - |
| 55 | + |
| 56 | + |
68 | 57 | |
69 | 58 | |
70 | 59 | |
|
Collapse file
lib/matplotlib/tri/triinterpolate.py
Copy file name to clipboardExpand all lines: lib/matplotlib/tri/triinterpolate.py+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1341 | 1341 | |
1342 | 1342 | |
1343 | 1343 | |
1344 | | - |
| 1344 | + |
1345 | 1345 | |
1346 | 1346 | |
1347 | 1347 | |
|
0 commit comments