diff options
author | Seth Troisi <sethtroisi@google.com> | 2020-01-23 16:49:01 -0800 |
---|---|---|
committer | Seth Troisi <sethtroisi@google.com> | 2020-01-23 16:52:25 -0800 |
commit | 823f6819dd86e75f772a3a725996773dd6b688e2 (patch) | |
tree | 85b754adb9f658fea27e9b7c4eeb383c16b1a1fd /numpy/core/shape_base.py | |
parent | 68224f43d09393c1981bb83ee3c13a5158d2817c (diff) | |
download | numpy-823f6819dd86e75f772a3a725996773dd6b688e2.tar.gz |
MAINT: Remove Python2 workarounds
Diffstat (limited to 'numpy/core/shape_base.py')
-rw-r--r-- | numpy/core/shape_base.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/numpy/core/shape_base.py b/numpy/core/shape_base.py index d2f26149b..e909cec6f 100644 --- a/numpy/core/shape_base.py +++ b/numpy/core/shape_base.py @@ -2,6 +2,7 @@ __all__ = ['atleast_1d', 'atleast_2d', 'atleast_3d', 'block', 'hstack', 'stack', 'vstack'] import functools +import itertools import operator import warnings @@ -530,14 +531,7 @@ def _atleast_nd(a, ndim): def _accumulate(values): - # Helper function because Python 2.7 doesn't have - # itertools.accumulate - value = 0 - accumulated = [] - for v in values: - value += v - accumulated.append(value) - return accumulated + return list(itertools.accumulate(values)) def _concatenate_shapes(shapes, axis): |