Skip to content

Commit cb89976

Browse files
committed
Add unstack to Sphinx and cleanup the docstring
1 parent dc56f27 commit cb89976

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

doc/source/reference/routines.array-manipulation.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ Splitting arrays
8888
dsplit
8989
hsplit
9090
vsplit
91+
unstack
9192

9293
Tiling arrays
9394
=============

numpy/_core/shape_base.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -463,12 +463,13 @@ def _unstack_dispatcher(x, *, axis=None):
463463
@array_function_dispatch(_unstack_dispatcher)
464464
def unstack(x, /, *, axis=0):
465465
"""
466-
Splits an array into a sequence of arrays along the given axis.
466+
Split an array into a sequence of arrays along the given axis.
467467
468-
The ``axis`` parameter specifies the axis along which the array will be
469-
split. of the new axis in the dimensions of the result. For example, if
470-
``axis=0`` it will be the first dimension and if ``axis=-1`` it will be
471-
the last dimension. The result is a tuple of arrays split along ``axis``.
468+
The ``axis`` parameter specifies the dimension along which the array will
469+
be split. For example, if ``axis=0`` (the default) it will be the first
470+
dimension and if ``axis=-1`` it will be the last dimension.
471+
472+
The result is a tuple of arrays split along ``axis``.
472473
473474
.. versionadded:: 2.1.0
474475
@@ -494,7 +495,7 @@ def unstack(x, /, *, axis=0):
494495
``unstack`` serves as the reverse operation of :py:func:`stack`, i.e.,
495496
``stack(unstack(x, axis=axis), axis=axis) == x``.
496497
497-
This function is equivalent to tuple(np.moveaxis(x, axis, 0)), since
498+
This function is equivalent to ``tuple(np.moveaxis(x, axis, 0))``, since
498499
iterating on an array iterates along the first axis.
499500
500501
Examples

0 commit comments

Comments
 (0)