-
Notifications
You must be signed in to change notification settings - Fork 4
compute nanquantiles
kgryte edited this page May 12, 2015
·
1 revision
Computes quantiles for an array
ignoring non-numeric values. num
specifies the number of quantiles to compute.
var data = [ 2, 4, null, 2, 7, NaN, 3 ];
var arr = compute.nanquantiles( data, 3 );
If the input array
is already sorted in ascending order, set the sorted
option to true
.
var opts = {
'sorted': true
};
var data = [ 2, 2, null, 3, 4, NaN, 7 ];
var arr = compute.nanquantiles( data, 2, opts );
// returns [ 2, 3, 7 ]
For object arrays
, provide an accessor function
for accessing array
values
var data = [
[1,2],
[2,2],
[3,null],
[4,3],
[5,4],
[6,NaN],
[7,7]
];
function getValue( d ) {
return d[ 1 ];
}
var opts = {
'sorted': true,
'accessor': getValue
};
var arr = compute.nanquantiles( data, 2, opts );
// returns [2, 3, 7 ]
- Utilities
- Array Creation
- Sorting and Reshaping Arrays
- Special Functions
- Arithmetic
- Relational Operations
- Logical Operations
- Trigonometry
- Geometry
- Sets
- Discrete Mathematics
- Linear Algebra
- Statistics