Functions which operate on array-valued cells. The array parameters of these functions can only be used on values which are already arrays (usually, numeric arrays). In most cases that means on values in table columns which are declared as array-valued. FITS and VOTable tables can have columns which contain array values, but other formats such as CSV cannot.
If you want to calculate aggregating functions like sum, min, max etc
on multiple values which are not part of an array,
it's easier to use the functions from the Lists
class.
Note that none of these functions will calculate statistical functions over a whole column of a table.
The functions fall into a number of categories:
size
,
count
,
countTrue
,
maximum
,
minimum
,
sum
,
mean
,
median
,
quantile
,
stdev
,
variance
,
join
.
add
,
subtract
,
multiply
,
divide
,
reciprocal
,
condition
.
array
,
which lets you assemble an array value from a list of scalar numbers.
This can be used with the aggregating functions here,
but it's generally easier to use the corresponding functions from
the Lists
class.
sum( array )
array
is not a numeric array, null
is returned.array
(Object): array of numbersarray
mean( array )
array
is not a numeric array, null
is returned.array
(Object): array of numbersarray
variance( array )
array
is not a numeric array,
null
is returned.array
(Object): array of numbersarray
stdev( array )
array
is not a numeric array,
null
is returned.array
(Object): array of numbersarray
minimum( array )
array
is not a numeric array, null
is returned.array
(Object): array of numbersarray
maximum( array )
array
is not a numeric array, null
is returned.array
(Object): array of numbersarray
median( array )
array
is not a numeric array, null
is returned.array
(Object): array of numbersarray
quantile( array, quant )
quant
value;
values of 0, 0.5 and 1 give the minimum, median and maximum
respectively. A value of 0.99 would give the 99th percentile.array
(Object): array of numbersquant
(floating point): number in the range 0-1 deterining which quantile
to calculatequant
size( array )
array
is not an array, zero is returned.array
(Object): arrayarray
count( array )
array
is not an array, zero is returned.array
(Object): array (may or may not be numeric)array
countTrue( array )
array
(array of boolean): array of true/false valuesarray
join( array, joiner )
array
is not an array, null is returned.array
(Object): array of numbers or stringsjoiner
(String): text string to interpose between adjacent elementsarray
elements separated by
joiner
stringsadd( array1, array2 )
null
is returned.
The types of the arrays do not need to be the same,
so for example it is permitted to add an integer array
to a floating point array.array1
(Object): first array of numeric valuesarray2
(Object): second array of numeric valuesarray1
and array2
,
the same length as the input arraysadd( array, constant )
array
argument is not a numeric array,
null
is returned.array
(Object): array inputconstant
(floating point): value to add to each array elementarray
parametersubtract( array1, array2 )
null
is returned.
The types of the arrays do not need to be the same,
so for example it is permitted to subtract an integer array
from a floating point array.array1
(Object): first array of numeric valuesarray2
(Object): second array of numeric valuesarray1
and array2
,
the same length as the input arraysmultiply( array1, array2 )
null
is returned.
The types of the arrays do not need to be the same,
so for example it is permitted to multiply an integer array
by a floating point array.array1
(Object): first array of numeric valuesarray2
(Object): second array of numeric valuesarray1
and array2
,
the same length as the input arraysmultiply( array, constant )
array
argument is not a numeric array,
null
is returned.array
(Object): array inputconstant
(floating point): value by which to multiply each array elementarray
parameterdivide( array1, array2 )
null
is returned.
The types of the arrays do not need to be the same,
so for example it is permitted to divide an integer array
by a floating point array.array1
(Object): array of numerator values (numeric)array2
(Object): array of denominator values (numeric)array1[i]/array2[i]
the same length as the input arraysreciprocal( array )
array
argument is not a numeric array,
null
is returned.array
(Object): array inputarray
parametercondition( flagArray, trueValue, falseValue )
This has the same effect as applying the expression
outArray[i] = flagArray[i] ? trueValue : falseValue
.
flagArray
(array of boolean): array of boolean valuestrueValue
(floating point): output value corresponding to an input true valuefalseValue
(floating point): output value corresponding to an input false valueflagArray
array( values, ... )
values
(floating point, one or more): one or more array elementsintArray( values, ... )
values
(integer, one or more): one or more array elementsstringArray( values, ... )
values
(String, one or more): one or more array elements