From a1800a7dfe68c499e0da41ec4037eba42ba2051c Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Sun, 10 May 2020 04:21:10 +0200 Subject: [PATCH] DOC: Unify cross-references between array joining methods --- .../reference/routines.array-manipulation.rst | 8 ++--- doc/source/reference/routines.ma.rst | 8 ++--- numpy/core/multiarray.py | 11 +++---- numpy/core/shape_base.py | 29 ++++++++++--------- numpy/lib/shape_base.py | 8 +++-- 5 files changed, 35 insertions(+), 29 deletions(-) diff --git a/doc/source/reference/routines.array-manipulation.rst b/doc/source/reference/routines.array-manipulation.rst index bf43232efa23..8d13a1800abf 100644 --- a/doc/source/reference/routines.array-manipulation.rst +++ b/doc/source/reference/routines.array-manipulation.rst @@ -69,11 +69,11 @@ Joining arrays concatenate stack - column_stack - dstack - hstack - vstack block + vstack + hstack + dstack + column_stack Splitting arrays ================ diff --git a/doc/source/reference/routines.ma.rst b/doc/source/reference/routines.ma.rst index 346ce2a1b794..97859ac67a24 100644 --- a/doc/source/reference/routines.ma.rst +++ b/doc/source/reference/routines.ma.rst @@ -145,13 +145,13 @@ Joining arrays .. autosummary:: :toctree: generated/ + ma.concatenate ma.stack + ma.vstack + ma.hstack + ma.dstack ma.column_stack - ma.concatenate ma.append - ma.dstack - ma.hstack - ma.vstack _____ diff --git a/numpy/core/multiarray.py b/numpy/core/multiarray.py index ec36f4f7e284..4d8b0077a3cd 100644 --- a/numpy/core/multiarray.py +++ b/numpy/core/multiarray.py @@ -171,14 +171,15 @@ def concatenate(arrays, axis=None, out=None): array_split : Split an array into multiple sub-arrays of equal or near-equal size. split : Split array into a list of multiple sub-arrays of equal size. - hsplit : Split array into multiple sub-arrays horizontally (column wise) - vsplit : Split array into multiple sub-arrays vertically (row wise) + hsplit : Split array into multiple sub-arrays horizontally (column wise). + vsplit : Split array into multiple sub-arrays vertically (row wise). dsplit : Split array into multiple sub-arrays along the 3rd axis (depth). stack : Stack a sequence of arrays along a new axis. - hstack : Stack arrays in sequence horizontally (column wise) - vstack : Stack arrays in sequence vertically (row wise) - dstack : Stack arrays in sequence depth wise (along third dimension) block : Assemble arrays from blocks. + hstack : Stack arrays in sequence horizontally (column wise). + vstack : Stack arrays in sequence vertically (row wise). + dstack : Stack arrays in sequence depth wise (along third dimension). + column_stack : Stack 1-D arrays as columns into a 2-D array. Notes ----- diff --git a/numpy/core/shape_base.py b/numpy/core/shape_base.py index ee56dbe43342..7a76bbf9dc15 100644 --- a/numpy/core/shape_base.py +++ b/numpy/core/shape_base.py @@ -247,12 +247,13 @@ def vstack(tup): See Also -------- + concatenate : Join a sequence of arrays along an existing axis. stack : Join a sequence of arrays along a new axis. + block : Assemble an nd-array from nested lists of blocks. hstack : Stack arrays in sequence horizontally (column wise). - dstack : Stack arrays in sequence depth wise (along third dimension). - concatenate : Join a sequence of arrays along an existing axis. - vsplit : Split array into a list of multiple sub-arrays vertically. - block : Assemble arrays from blocks. + dstack : Stack arrays in sequence depth wise (along third axis). + column_stack : Stack 1-D arrays as columns into a 2-D array. + vsplit : Split an array into multiple sub-arrays vertically (row-wise). Examples -------- @@ -309,12 +310,13 @@ def hstack(tup): See Also -------- + concatenate : Join a sequence of arrays along an existing axis. stack : Join a sequence of arrays along a new axis. + block : Assemble an nd-array from nested lists of blocks. vstack : Stack arrays in sequence vertically (row wise). dstack : Stack arrays in sequence depth wise (along third axis). - concatenate : Join a sequence of arrays along an existing axis. - hsplit : Split array along second axis. - block : Assemble arrays from blocks. + column_stack : Stack 1-D arrays as columns into a 2-D array. + hsplit : Split an array into multiple sub-arrays horizontally (column-wise). Examples -------- @@ -385,8 +387,8 @@ def stack(arrays, axis=0, out=None): See Also -------- concatenate : Join a sequence of arrays along an existing axis. + block : Assemble an nd-array from nested lists of blocks. split : Split array into a list of multiple sub-arrays of equal size. - block : Assemble arrays from blocks. Examples -------- @@ -723,12 +725,13 @@ def block(arrays): See Also -------- - concatenate : Join a sequence of arrays together. - stack : Stack arrays in sequence along a new dimension. - hstack : Stack arrays in sequence horizontally (column wise). + concatenate : Join a sequence of arrays along an existing axis. + stack : Join a sequence of arrays along a new axis. vstack : Stack arrays in sequence vertically (row wise). - dstack : Stack arrays in sequence depth wise (along third dimension). - vsplit : Split array into a list of multiple sub-arrays vertically. + hstack : Stack arrays in sequence horizontally (column wise). + dstack : Stack arrays in sequence depth wise (along third axis). + column_stack : Stack 1-D arrays as columns into a 2-D array. + vsplit : Split an array into multiple sub-arrays vertically (row-wise). Notes ----- diff --git a/numpy/lib/shape_base.py b/numpy/lib/shape_base.py index 72a7f79d7206..78703555eb2f 100644 --- a/numpy/lib/shape_base.py +++ b/numpy/lib/shape_base.py @@ -688,10 +688,12 @@ def dstack(tup): See Also -------- - stack : Join a sequence of arrays along a new axis. - vstack : Stack along first axis. - hstack : Stack along second axis. concatenate : Join a sequence of arrays along an existing axis. + stack : Join a sequence of arrays along a new axis. + block : Assemble an nd-array from nested lists of blocks. + vstack : Stack arrays in sequence vertically (row wise). + hstack : Stack arrays in sequence horizontally (column wise). + column_stack : Stack 1-D arrays as columns into a 2-D array. dsplit : Split array along third axis. Examples