forked from stdlib-js/stdlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrepl.txt
More file actions
42 lines (31 loc) · 1.17 KB
/
repl.txt
File metadata and controls
42 lines (31 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{{alias}}( x, axis, writable )
Expands the shape of an array by inserting a new dimension of size one at a
specified axis.
A provided axis must reside on the interval `[-N-1, N]`, where `N` is the
rank (i.e., number of dimensions) of the provided input array.
If provided a negative axis value, the axis position at which to insert a
singleton dimension is computed as `N + axis + 1`. Hence, if provided `-1`,
the resolved axis position is `N` (i.e., a singleton dimension is appended
to the input array).
The `writable` parameter only applies to ndarray constructors supporting
read-only instances.
Parameters
----------
x: ndarray
Input array.
axis: integer
Axis at which to insert a singleton dimension.
writable: boolean
Boolean indicating whether the returned ndarray should be writable.
Returns
-------
out: ndarray
Output array.
Examples
--------
> var x = {{alias:@stdlib/ndarray/array}}( [ [ 1, 2 ], [ 3, 4 ] ] )
<ndarray>[ [ 1, 2 ], [ 3, 4 ] ]
> var y = {{alias}}( x, 1, false )
<ndarray>[ [ [ 1, 2 ] ], [ [ 3, 4 ] ] ]
See Also
--------