diff options
author | Felix Divo <felixdivo@users.noreply.github.com> | 2019-09-16 00:17:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-16 00:17:41 +0200 |
commit | 805e245809c42e33b45aee5c06ab800aaeb0dfd7 (patch) | |
tree | f318d5a4ad045848ed21825ad6e7bf35881dd772 /numpy/lib/shape_base.py | |
parent | 33d5f9c23da18ed3b5ed5b8efc5c26297ed2d7ea (diff) | |
download | numpy-805e245809c42e33b45aee5c06ab800aaeb0dfd7.tar.gz |
Mention that split() returns views into the original array
Also adds a minor code change
Diffstat (limited to 'numpy/lib/shape_base.py')
-rw-r--r-- | numpy/lib/shape_base.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/numpy/lib/shape_base.py b/numpy/lib/shape_base.py index a5d0040aa..92d52109e 100644 --- a/numpy/lib/shape_base.py +++ b/numpy/lib/shape_base.py @@ -782,7 +782,7 @@ def _split_dispatcher(ary, indices_or_sections, axis=None): @array_function_dispatch(_split_dispatcher) def split(ary, indices_or_sections, axis=0): """ - Split an array into multiple sub-arrays. + Split an array into multiple sub-arrays as views into `ary`. Parameters ---------- @@ -809,7 +809,7 @@ def split(ary, indices_or_sections, axis=0): Returns ------- sub-arrays : list of ndarrays - A list of sub-arrays. + A list of sub-arrays as views into `ary`. Raises ------ @@ -854,8 +854,7 @@ def split(ary, indices_or_sections, axis=0): if N % sections: raise ValueError( 'array split does not result in an equal division') - res = array_split(ary, indices_or_sections, axis) - return res + return array_split(ary, indices_or_sections, axis) def _hvdsplit_dispatcher(ary, indices_or_sections): |