-
Notifications
You must be signed in to change notification settings - Fork 4
compute nansum
kgryte edited this page May 12, 2015
·
1 revision
Computes the sum of an array
ignoring non-numeric values.
var data = [ 2, NaN, 4, 2, 7, NaN, 3 ];
var sum = compute.nansum( data );
// returns 18
For object arrays
, provide an accessor function
for accessing array
values
var data = [
[1,2],
[2,NaN],
[3,4],
[4,2],
[5,7],
[6,NaN],
[7,3]
];
function getValue( d ) {
return d[ 1 ];
}
var sum = compute.nansum( data, getValue );
// returns 18
- Utilities
- Array Creation
- Sorting and Reshaping Arrays
- Special Functions
- Arithmetic
- Relational Operations
- Logical Operations
- Trigonometry
- Geometry
- Sets
- Discrete Mathematics
- Linear Algebra
- Statistics