|
12 | 12 |
|
13 | 13 | from collections import defaultdict |
14 | 14 | import functools |
15 | | -from functools import reduce |
16 | | -from itertools import compress |
| 15 | +import itertools |
17 | 16 | import math |
18 | 17 | import textwrap |
19 | 18 |
|
20 | 19 | import numpy as np |
21 | 20 |
|
22 | | -from matplotlib import artist |
23 | | -from matplotlib import _api |
| 21 | +from matplotlib import _api, artist, cbook, docstring |
24 | 22 | import matplotlib.axes as maxes |
25 | | -import matplotlib.cbook as cbook |
26 | 23 | import matplotlib.collections as mcoll |
27 | 24 | import matplotlib.colors as mcolors |
28 | | -import matplotlib.docstring as docstring |
29 | 25 | import matplotlib.scale as mscale |
30 | 26 | import matplotlib.container as mcontainer |
31 | 27 | import matplotlib.transforms as mtransforms |
@@ -2710,7 +2706,7 @@ def calc_arrows(UVW, angle=15): |
2710 | 2706 | masks = bcast[argi:] |
2711 | 2707 | if masks: |
2712 | 2708 | # combine the masks into one |
2713 | | - mask = reduce(np.logical_or, masks) |
| 2709 | + mask = functools.reduce(np.logical_or, masks) |
2714 | 2710 | # put mask on and compress |
2715 | 2711 | input_args = [np.ma.array(k, mask=mask).compressed() |
2716 | 2712 | for k in input_args] |
@@ -3203,7 +3199,7 @@ def errorbar(self, x, y, z, zerr=None, yerr=None, xerr=None, fmt='', |
3203 | 3199 | def _apply_mask(arrays, mask): |
3204 | 3200 | # Return, for each array in *arrays*, the elements for which *mask* |
3205 | 3201 | # is True, without using fancy indexing. |
3206 | | - return [[*compress(array, mask)] for array in arrays] |
| 3202 | + return [[*itertools.compress(array, mask)] for array in arrays] |
3207 | 3203 |
|
3208 | 3204 | def _extract_errs(err, data, lomask, himask): |
3209 | 3205 | # For separate +/- error values we need to unpack err |
|
0 commit comments