You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/node_modules/@stdlib/ndarray/shift/README.md
+17-34Lines changed: 17 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ limitations under the License.
20
20
21
21
# shift
22
22
23
-
> Return an array containing a read-only truncated view of an input [`ndarray`][@stdlib/ndarray/ctor] and a read-only view of the first element(s) along a specific dimension.
23
+
> Return an array containing a read-only truncated view of an input [`ndarray`][@stdlib/ndarray/ctor] and a read-only view of the first element(s) along a specified dimension.
24
24
25
25
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
26
26
@@ -42,24 +42,17 @@ var shift = require( '@stdlib/ndarray/shift' );
42
42
43
43
#### shift( x\[, options] )
44
44
45
-
Returns an array containing a **read-only** truncated view of an input [`ndarray`][@stdlib/ndarray/ctor] and a **read-only** view of the first element(s) along a specific dimension.
45
+
Returns an array containing a **read-only** truncated view of an input [`ndarray`][@stdlib/ndarray/ctor] and a **read-only** view of the first element(s) along a specified dimension.
46
46
47
47
```javascript
48
-
var ndarray =require( '@stdlib/ndarray/ctor' );
49
-
var getShape =require( '@stdlib/ndarray/shape' );
48
+
var array =require( '@stdlib/ndarray/array' );
50
49
var ndarray2array =require( '@stdlib/ndarray/to-array' );
51
50
52
-
var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];
53
-
var shape = [ 3, 2 ];
54
-
var strides = [ 2, 1 ];
55
-
var offset =0;
56
-
57
-
var x =ndarray( 'generic', buffer, shape, strides, offset, 'row-major' );
@@ -82,24 +75,17 @@ The function supports the following `options`:
82
75
83
76
-**dim**: dimension along which to perform the operation. If provided an integer less than zero, the dimension index is resolved relative to the last dimension, with the last dimension corresponding to the value `-1`. Default: `0`.
84
77
85
-
By default, the function performs operation along the first dimension of the input [`ndarray`][@stdlib/ndarray/ctor]. To perform operation along a desired dimension, provide the `dim` option.
78
+
By default, the function performs operation along the first dimension of the input [`ndarray`][@stdlib/ndarray/ctor]. To perform operation along a specific dimension, provide the `dim` option.
86
79
87
80
```javascript
88
-
var ndarray =require( '@stdlib/ndarray/ctor' );
89
-
var getShape =require( '@stdlib/ndarray/shape' );
81
+
var array =require( '@stdlib/ndarray/array' );
90
82
var ndarray2array =require( '@stdlib/ndarray/to-array' );
91
83
92
-
var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];
93
-
var shape = [ 3, 2 ];
94
-
var strides = [ 2, 1 ];
95
-
var offset =0;
96
-
97
-
var x =ndarray( 'generic', buffer, shape, strides, offset, 'row-major' );
Copy file name to clipboardExpand all lines: lib/node_modules/@stdlib/ndarray/shift/package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
{
2
2
"name": "@stdlib/ndarray/shift",
3
3
"version": "0.0.0",
4
-
"description": "Return an array containing a read-only truncated view of an input ndarray and a read-only view of the first element(s) along a specific dimension.",
4
+
"description": "Return an array containing a read-only truncated view of an input ndarray and a read-only view of the first element(s) along a specified dimension.",
0 commit comments