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/stats/maxsorted/README.md
+10-39Lines changed: 10 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,10 +40,7 @@ var array = require( '@stdlib/ndarray/array' );
40
40
var x =array( [ 1.0, 2.0, 3.0 ] );
41
41
42
42
var y =maxsorted( x );
43
-
// returns <ndarray>
44
-
45
-
var v =y.get();
46
-
// returns 3.0
43
+
// returns <ndarray>[ 3.0 ]
47
44
```
48
45
49
46
The function has the following parameters:
@@ -60,81 +57,58 @@ The function accepts the following options:
60
57
By default, the function performs a reduction over all elements in a provided input [ndarray][@stdlib/ndarray/ctor]. To perform a reduction over specific dimensions, provide a `dims` option.
61
58
62
59
```javascript
63
-
var ndarray2array =require( '@stdlib/ndarray/to-array' );
64
60
var array =require( '@stdlib/ndarray/array' );
65
61
66
62
var x =array( [ 1.0, 2.0, 3.0, 4.0 ], {
67
63
'shape': [ 2, 2 ],
68
64
'order':'row-major'
69
65
});
70
-
var v =ndarray2array( x );
71
-
// returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ]
66
+
// returns <ndarray>
72
67
73
68
var y =maxsorted( x, {
74
69
'dims': [ 0 ]
75
70
});
76
-
// returns <ndarray>
77
-
78
-
v =ndarray2array( y );
79
-
// returns [ 3.0, 4.0 ]
71
+
// returns <ndarray>[ 3.0, 4.0 ]
80
72
81
73
y =maxsorted( x, {
82
74
'dims': [ 1 ]
83
75
});
84
-
// returns <ndarray>
85
-
86
-
v =ndarray2array( y );
87
-
// returns [ 2.0, 4.0 ]
76
+
// returns <ndarray>[ 2.0, 4.0 ]
88
77
89
78
y =maxsorted( x, {
90
79
'dims': [ 0, 1 ]
91
80
});
92
-
// returns <ndarray>
93
-
94
-
v =y.get();
95
-
// returns 4.0
81
+
// returns <ndarray>[ 4.0 ]
96
82
```
97
83
98
84
By default, the function excludes reduced dimensions from the output [ndarray][@stdlib/ndarray/ctor]. To include the reduced dimensions as singleton dimensions, set the `keepdims` option to `true`.
99
85
100
86
```javascript
101
-
var ndarray2array =require( '@stdlib/ndarray/to-array' );
102
87
var array =require( '@stdlib/ndarray/array' );
103
88
104
89
var x =array( [ 1.0, 2.0, 3.0, 4.0 ], {
105
90
'shape': [ 2, 2 ],
106
91
'order':'row-major'
107
92
});
108
-
109
-
var v =ndarray2array( x );
110
-
// returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ]
93
+
// returns <ndarray>
111
94
112
95
var y =maxsorted( x, {
113
96
'dims': [ 0 ],
114
97
'keepdims':true
115
98
});
116
-
// returns <ndarray>
117
-
118
-
v =ndarray2array( y );
119
-
// returns [ [ 3.0, 4.0 ] ]
99
+
// returns <ndarray>[ [ 3.0, 4.0 ] ]
120
100
121
101
y =maxsorted( x, {
122
102
'dims': [ 1 ],
123
103
'keepdims':true
124
104
});
125
-
// returns <ndarray>
126
-
127
-
v =ndarray2array( y );
128
-
// returns [ [ 2.0 ], [ 4.0 ] ]
105
+
// returns <ndarray>[ [ 2.0 ], [ 4.0 ] ]
129
106
130
107
y =maxsorted( x, {
131
108
'dims': [ 0, 1 ],
132
109
'keepdims':true
133
110
});
134
-
// returns <ndarray>
135
-
136
-
v =ndarray2array( y );
137
-
// returns [ [ 4.0 ] ]
111
+
// returns <ndarray>[ [ 4.0 ] ]
138
112
```
139
113
140
114
By default, the function returns an [ndarray][@stdlib/ndarray/ctor] having a [data type][@stdlib/ndarray/dtypes] determined by the function's output data type [policy][@stdlib/ndarray/output-dtype-policies]. To override the default behavior, set the `dtype` option.
@@ -168,10 +142,7 @@ var x = array( [ 1.0, 2.0, 3.0 ] );
Copy file name to clipboardExpand all lines: lib/node_modules/@stdlib/stats/maxsorted/docs/types/index.d.ts
+4-16Lines changed: 4 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -75,10 +75,7 @@ interface Unary {
75
75
* var x = array( [ 1.0, 2.0, 3.0 ] );
76
76
*
77
77
* var y = maxsorted( x );
78
-
* // returns <ndarray>
79
-
*
80
-
* var v = y.get();
81
-
* // returns 3.0
78
+
* // returns <ndarray>[ 3.0 ]
82
79
*/
83
80
<T=unknown,U=unknown>(x: InputArray<T>,options?: Options): OutputArray<U>;// NOTE: we lose type specificity here, but retaining specificity would likely be difficult and/or tedious to completely enumerate, as the output ndarray data type is dependent on how `x` interacts with output data type policy and whether that policy has been overridden by `options.dtype`.
0 commit comments