类 ArrayMath


  • public class ArrayMath
    extends Object
    作者:
    wyq
    • 字段详细资料

      • fill_value

        public static double fill_value
    • 构造器详细资料

      • ArrayMath

        public ArrayMath()
    • 方法详细资料

      • getDataType

        public static DataType getDataType​(Object o)
        Get data type
        参数:
        o - Object
        返回:
        Data type
      • typeToNBytes

        public static short typeToNBytes​(DataType dataType)
        Return the number of bytes per element for the given typecode.
        参数:
        dataType - Data type
        返回:
        Bytes number
      • isComplex

        public static boolean isComplex​(Array a)
        Check if an array is complex data type
        参数:
        a - The array
        返回:
        Complex data type or not
      • isNumeric

        public static boolean isNumeric​(Array a)
        Check if an array is numeric array
        参数:
        a - The array
        返回:
        Numeric or not
      • broadcastCheck

        public static int broadcastCheck​(Array a,
                                         Array b)
        Broadcast check for two arrays.
        参数:
        a - Array a
        b - Array b
        返回:
        Can broadcast (1), can not broadcast (-1), same dimensions (0)
      • broadcast

        public static int[] broadcast​(Array a,
                                      Array b)
        Get broadcast shape from two arrays
        参数:
        a - Array a
        b - Array b
        返回:
        Broadcast shape
      • add

        public static Array add​(Array a,
                                Array b)
        Array add
        参数:
        a - Array a
        b - Array b
        返回:
        Added array
      • add

        public static Array add​(Array a,
                                Number b)
        Array add
        参数:
        a - Array a
        b - Number b
        返回:
        Added array
      • add

        public static Array add​(Array a,
                                Complex b)
        Array add
        参数:
        a - Array a
        b - Complex number b
        返回:
        Added array
      • sub

        public static Array sub​(Array a,
                                Array b)
        Array subtract
        参数:
        a - Array a
        b - Array b
        返回:
        Result array
      • sub

        public static Array sub​(Array a,
                                Number b)
        Array subtract
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • sub

        public static Array sub​(Array a,
                                Complex b)
        Array subtract
        参数:
        a - Array a
        b - Complex number b
        返回:
        Result array
      • sub

        public static Array sub​(Number b,
                                Array a)
        Array subtract
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • sub

        public static Array sub​(Complex b,
                                Array a)
        Array subtract
        参数:
        a - Array a
        b - Complex number b
        返回:
        Result array
      • mul

        public static Array mul​(Array a,
                                Array b)
        Array mutiply
        参数:
        a - Array a
        b - Array b
        返回:
        Result array
      • mul

        public static Array mul​(Array a,
                                Number b)
        Array multiply
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • mul

        public static Array mul​(Array a,
                                Complex b)
        Array multiply
        参数:
        a - Array a
        b - Complex number b
        返回:
        Result array
      • div

        public static Array div​(Array a,
                                Array b)
        Array divide
        参数:
        a - Array a
        b - Array b
        返回:
        Result array
      • div

        public static Array div​(Array a,
                                Number b)
        Array divide
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • div

        public static Array div​(Array a,
                                Complex b)
        Array divide
        参数:
        a - Array a
        b - Complex number b
        返回:
        Result array
      • div

        public static Array div​(Number b,
                                Array a)
        Array divide
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • div

        public static Array div​(Complex b,
                                Array a)
        Array divide
        参数:
        a - Array a
        b - Complex number b
        返回:
        Result array
      • mod

        public static Array mod​(Array a,
                                Array b)
        Array mod
        参数:
        a - Array a
        b - Array b
        返回:
        Result array
      • mod

        public static Array mod​(Array a,
                                Number b)
        Array mod
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • mod

        public static Array mod​(Number b,
                                Array a)
        Array mod
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • floorDiv

        public static Array floorDiv​(Array a,
                                     Array b)
        Array mod
        参数:
        a - Array a
        b - Array b
        返回:
        Result array
      • floorDiv

        public static Array floorDiv​(Array a,
                                     Number b)
        Array floor divide
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • floorDiv

        public static Array floorDiv​(Number b,
                                     Array a)
        Array floor divide
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • pow

        public static Array pow​(Array a,
                                Number b)
        Array pow function
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • pow

        public static Array pow​(Array a,
                                Complex b)
        Array pow function
        参数:
        a - Array a
        b - Complex number b
        返回:
        Result array
      • pow

        public static Array pow​(Number a,
                                Array b)
        Array pow function
        参数:
        a - Number a
        b - Array b
        返回:
        Result array
      • pow

        public static Array pow​(Complex b,
                                Array a)
        Array pow function
        参数:
        a - Array a
        b - Complex number b
        返回:
        Result array
      • pow

        public static Array pow​(Array a,
                                Array b)
        Array pow function
        参数:
        a - Number a
        b - Array b
        返回:
        Result array
      • sqrt

        public static Array sqrt​(Array a)
        Sqrt function
        参数:
        a - Array a
        返回:
        Result array
      • exp

        public static Array exp​(Array a)
        Exponent function
        参数:
        a - Array a
        返回:
        Result array
      • log

        public static Array log​(Array a)
        Log function
        参数:
        a - Array a
        返回:
        Result array
      • log10

        public static Array log10​(Array a)
        Log10 function
        参数:
        a - Array a
        返回:
        Result array
      • abs

        public static Array abs​(Array a)
        Array absolute
        参数:
        a - Array a
        返回:
        Result array
      • ceil

        public static Array ceil​(Array a)
        Return the ceiling of the input, element-wise.
        参数:
        a - Array a
        返回:
        Result array
      • floor

        public static Array floor​(Array a)
        Return the ceiling of the input, element-wise.
        参数:
        a - Array a
        返回:
        Result array
      • equal

        public static Array equal​(Array a,
                                  Array b)
        Array equal
        参数:
        a - Array a
        b - Array b
        返回:
        Result array
      • equal

        public static Array equal​(Array a,
                                  Number b)
        Array equal
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • equal

        public static Array equal​(Array a,
                                  String b)
        Array equal
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • isClose

        public static boolean isClose​(Number a,
                                      Number b,
                                      double rTol,
                                      double aTol)
        Returns a boolean where two number are equal within a tolerance.
        参数:
        a - Number a.
        b - Number b.
        rTol - The relative tolerance parameter
        aTol - The absolute tolerance parameter
        返回:
        Result boolean
      • isClose

        public static boolean isClose​(Number a,
                                      Number b,
                                      double rTol,
                                      double aTol,
                                      boolean equalNaN)
        Returns a boolean where two number are equal within a tolerance.
        参数:
        a - Number a.
        b - Number b.
        rTol - The relative tolerance parameter
        aTol - The absolute tolerance parameter
        equalNaN - Whether to compare NaN’s as equal
        返回:
        Result boolean
      • isClose

        public static Array isClose​(Array a,
                                    Array b,
                                    double rTol,
                                    double aTol)
        Returns a boolean array where two arrays are element-wise equal within a tolerance.
        参数:
        a - Input array a.
        b - Input array b.
        rTol - The relative tolerance parameter
        aTol - The absolute tolerance parameter
        返回:
        Result array
      • isClose

        public static Array isClose​(Array a,
                                    Array b,
                                    double rTol,
                                    double aTol,
                                    boolean equalNaN)
        Returns a boolean array where two arrays are element-wise equal within a tolerance.
        参数:
        a - Input array a.
        b - Input array b.
        rTol - The relative tolerance parameter
        aTol - The absolute tolerance parameter
        equalNaN - Whether to compare NaN’s as equal
        返回:
        Result array
      • isClose

        public static Array isClose​(Array a,
                                    Number b,
                                    double rTol,
                                    double aTol,
                                    boolean equalNaN)
        Returns a boolean array where two arrays are element-wise equal within a tolerance.
        参数:
        a - Input array a.
        b - Input number b.
        rTol - The relative tolerance parameter
        aTol - The absolute tolerance parameter
        equalNaN - Whether to compare NaN’s as equal
        返回:
        Result array
      • isInfinite

        public static Array isInfinite​(Array a)
        Test element-wise for positive or negative infinity.
        参数:
        a - Array a
        返回:
        Result array
      • isFinite

        public static Array isFinite​(Array a)
        Test element-wise for finiteness (not infinity or not Not a Number).
        参数:
        a - Array a
        返回:
        Result array
      • lessThan

        public static Array lessThan​(Array a,
                                     Array b)
        Array less than
        参数:
        a - Array a
        b - Array b
        返回:
        Result array
      • lessThan

        public static Array lessThan​(Array a,
                                     Number b)
        Array less than
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • lessThanOrEqual

        public static Array lessThanOrEqual​(Array a,
                                            Array b)
        Array less than or equal
        参数:
        a - Array a
        b - Array b
        返回:
        Result array
      • lessThanOrEqual

        public static Array lessThanOrEqual​(Array a,
                                            Number b)
        Array less than or equal
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • greaterThan

        public static Array greaterThan​(Array a,
                                        Array b)
        Array greater than
        参数:
        a - Array a
        b - Array b
        返回:
        Result array
      • greaterThan

        public static Array greaterThan​(Array a,
                                        Number b)
        Array greater than
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • greaterThanOrEqual

        public static Array greaterThanOrEqual​(Array a,
                                               Array b)
        Array greater than or equal
        参数:
        a - Array a
        b - Array b
        返回:
        Result array
      • greaterThanOrEqual

        public static Array greaterThanOrEqual​(Array a,
                                               Number b)
        Array greater than or equal
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • notEqual

        public static Array notEqual​(Array a,
                                     Array b)
        Array not equal
        参数:
        a - Array a
        b - Array b
        返回:
        Result array
      • notEqual

        public static Array notEqual​(Array a,
                                     Number b)
        Array not equal
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • any

        public static boolean any​(Array a)
        Test whether any array element evaluates to True.
        参数:
        a - The array
        返回:
        Boolean
      • all

        public static boolean all​(Array a)
        Test whether all array element evaluates to True.
        参数:
        a - The array
        返回:
        Boolean
      • inValues

        public static Array inValues​(Array a,
                                     List b)
        Return the array with the value of 1 when the input array element value in the list b, otherwise set value as 0.
        参数:
        a - Array a
        b - List b
        返回:
        Result array
      • containsNaN

        public static boolean containsNaN​(Array a)
        Check if the array contains NaN value
        参数:
        a - Input array
        返回:
        Boolean
      • removeNaN

        public static Array removeNaN​(Array a)
        Remove NaN values in an array
        参数:
        a - The array
        返回:
        The array withou NaN values
      • removeNaN

        public static Array[] removeNaN​(Array... a)
        Remove NaN values in arrays
        参数:
        a - The arrays
        返回:
        The array withou NaN values
      • bitAnd

        public static Array bitAnd​(Array a,
                                   Number b)
        Bit and operation
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • bitAnd

        public static Array bitAnd​(Array a,
                                   Array b)
        Bit and operation
        参数:
        a - Array a
        b - Array b
        返回:
        Result array
      • bitOr

        public static Array bitOr​(Array a,
                                  Number b)
        Bit or | operation
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • bitOr

        public static Array bitOr​(Array a,
                                  Array b)
        Bit or | operation
        参数:
        a - Array a
        b - Array b
        返回:
        Result array
      • bitXor

        public static Array bitXor​(Array a,
                                   Number b)
        Bit exclusive or ^ operation
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • bitXor

        public static Array bitXor​(Array a,
                                   Array b)
        Bit exclusive or | operation
        参数:
        a - Array a
        b - Array b
        返回:
        Result array
      • bitInvert

        public static Array bitInvert​(Array a)
        Bit inversion ~ operation
        参数:
        a - Array a
        返回:
        Result array
      • logicalNot

        public static Array logicalNot​(Array a)
        Logical not
        参数:
        a - Array a
        返回:
        Result array
      • leftShift

        public static Array leftShift​(Array a,
                                      Number b)
        Bit left shift operation
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • leftShift

        public static Array leftShift​(Array a,
                                      Array b)
        Bit left shift operation
        参数:
        a - Array a
        b - Array b
        返回:
        Result array
      • rightShift

        public static Array rightShift​(Array a,
                                       Number b)
        Bit right shift operation
        参数:
        a - Array a
        b - Number b
        返回:
        Result array
      • rightShift

        public static Array rightShift​(Array a,
                                       Array b)
        Bit right shift operation
        参数:
        a - Array a
        b - Array b
        返回:
        Result array
      • trapz

        public static double trapz​(Array y,
                                   double dx)
        Integrate vector array using the composite trapezoidal rule.
        参数:
        y - Vecotr array
        dx - Spacing between all y elements
        返回:
        Definite integral as approximated by trapezoidal rule
      • trapz

        public static double trapz​(Array y,
                                   double dx,
                                   List<Range> ranges)
                            throws InvalidRangeException
        Integrate vector array using the composite trapezoidal rule.
        参数:
        y - Vecotr array
        dx - Spacing between all y elements
        ranges -
        返回:
        Definite integral as approximated by trapezoidal rule
        抛出:
        InvalidRangeException
      • trapz

        public static double trapz​(Array y,
                                   Array x)
        Integrate vector array using the composite trapezoidal rule.
        参数:
        y - Vecotr array
        x - Spacing array between all y elements
        返回:
        Definite integral as approximated by trapezoidal rule
      • trapz

        public static double trapz​(Array y,
                                   Array x,
                                   List<Range> ranges)
                            throws InvalidRangeException
        Integrate vector array using the composite trapezoidal rule.
        参数:
        y - Vecotr array
        x - Spacing array between all y elements
        ranges - Ranges
        返回:
        Definite integral as approximated by trapezoidal rule
        抛出:
        InvalidRangeException
      • sign

        public static Array sign​(Array x)
        Returns an element-wise indication of the sign of a number. The sign function returns -1 if x less than 0, 0 if x==0, 1 if x bigger than 0. nan is returned for nan inputs.
        参数:
        x - Input array
        返回:
        The sign of x array
      • dot

        public static Array dot​(Array a,
                                Array b)
        Matrix multiplication
        参数:
        a - Array a
        b - Array b
        返回:
        Result array
      • vdot

        public static double vdot​(Array a,
                                  Array b)
        Return the dot product of two vectors.
        参数:
        a - Vector a
        b - Vector b
        返回:
        Result
      • outer

        public static Array outer​(Array a,
                                  Array b)
        Compute the outer product of two vectors.
        参数:
        a - Vector a
        b - Vector b
        返回:
        The outer product
      • toDegrees

        public static Array toDegrees​(Array a)
        Convert radians to degrees function
        参数:
        a - Array a
        返回:
        Result array
      • toRadians

        public static Array toRadians​(Array a)
        Convert radians to degrees function
        参数:
        a - Array a
        返回:
        Result array
      • sin

        public static Array sin​(Array a)
        Sine function
        参数:
        a - Array a
        返回:
        Result array
      • sinh

        public static Array sinh​(Array a)
        Hyperbolic sine function
        参数:
        a - Array a
        返回:
        Result array
      • cos

        public static Array cos​(Array a)
        Cosine function
        参数:
        a - Array a
        返回:
        Result array
      • cosh

        public static Array cosh​(Array a)
        Hyperbolic cosine function
        参数:
        a - Array a
        返回:
        Result array
      • tan

        public static Array tan​(Array a)
        Tangent function
        参数:
        a - Array a
        返回:
        Result array
      • tanh

        public static Array tanh​(Array a)
        Hyperbolic tangent function
        参数:
        a - Array a
        返回:
        Result array
      • asin

        public static Array asin​(Array a)
        Arc sine function
        参数:
        a - Array a
        返回:
        Result array
      • acos

        public static Array acos​(Array a)
        Arc cosine function
        参数:
        a - Array a
        返回:
        Result array
      • atan

        public static Array atan​(Array a)
        Arc tangen function
        参数:
        a - Array a
        返回:
        Result array
      • atan2

        public static Array atan2​(Array a,
                                  Array b)
        Arc tangen function
        参数:
        a - Array a
        b - Array b
        返回:
        Result array
      • cartesianToPolar

        public static Array[] cartesianToPolar​(Array x,
                                               Array y)
        Convert cartesian to polar coordinate
        参数:
        x - X array
        y - Y array
        返回:
        Angle and radius
      • polarToCartesian

        public static Array[] polarToCartesian​(Array B,
                                               Array r)
        Convert poar to cartesian coordinate
        参数:
        r - Radius
        B - Angle in radians
        返回:
        X and y in cartesian coordinate
      • cartesianToPolar

        public static double[] cartesianToPolar​(double x,
                                                double y)
        Convert cartesian to polar coordinate
        参数:
        x - X
        y - Y
        返回:
        Angle and radius
      • polarToCartesian

        public static double[] polarToCartesian​(double B,
                                                double r)
        Convert poar to cartesian coordinate
        参数:
        r - Radius
        B - Angle in radians
        返回:
        X and y in cartesian coordinate
      • copy

        public static Array copy​(Array a)
        Copy array
        参数:
        a - Input array
        返回:
        Copied array
      • section

        public static Array section​(Array a,
                                    int[] origin,
                                    int[] size,
                                    int[] stride)
                             throws InvalidRangeException
        Section array
        参数:
        a - Array a
        origin - Origin array
        size - Size array
        stride - Stride array
        返回:
        Result array
        抛出:
        InvalidRangeException
      • take

        public static Array take​(Array a,
                                 Array condition)
        Extract 1D array by boolean array
        参数:
        a - The data array
        condition - The boolean array
        返回:
        Extracted array
      • take

        public static Array take​(Array a,
                                 Array indices,
                                 Integer axis)
                          throws InvalidRangeException
        Take elements from an array along an axis.
        参数:
        a - The array
        indices - The indices of the values to extract.
        axis - The axis over which to select values.
        返回:
        The returned array has the same type as a.
        抛出:
        InvalidRangeException
      • take

        public static Array take​(Array a,
                                 List<Object> ranges)
        Take elements from an array along an axis.
        参数:
        a - The array
        ranges - The indices of the values to extract.
        返回:
        The returned array has the same type as a.
      • takeValuesList

        public static Array takeValuesList​(Array a,
                                           List<List<Integer>> ranges)
        Take elements from an array.
        参数:
        a - The array
        ranges - The indices of the values to extract.
        返回:
        The returned array has the same type as a.
      • takeValues

        public static Array takeValues​(Array a,
                                       List<Array> ranges)
        Take elements from an array.
        参数:
        a - The array
        ranges - The indices of the values to extract.
        返回:
        The returned array has the same type as a.
      • setSection_Mix

        public static Array setSection_Mix​(Array a,
                                           List<Object> ranges,
                                           Number v)
        Set section
        参数:
        a - Array a
        ranges - Ranges
        v - Number value
        返回:
        Result array
      • setSection_Mix_Bak

        public static Array setSection_Mix_Bak​(Array a,
                                               List<Object> ranges,
                                               Number v)
        Set section
        参数:
        a - Array a
        ranges - Ranges
        v - Number value
        返回:
        Result array
      • setSection_Mix

        public static Array setSection_Mix​(Array a,
                                           List<Object> ranges,
                                           Array v)
        Set section
        参数:
        a - Array a
        ranges - Ranges
        v - Array value
        返回:
        Result array
      • setSection_Mix_Bak

        public static Array setSection_Mix_Bak​(Array a,
                                               List<Object> ranges,
                                               Array v)
        Set section
        参数:
        a - Array a
        ranges - Ranges
        v - Array value
        返回:
        Result array
      • setSection_List

        public static Array setSection_List​(Array a,
                                            List<List<Integer>> ranges,
                                            Number v)
        Set section
        参数:
        a - Array a
        ranges - Ranges
        v - Number value
        返回:
        Result array
      • setSection_List

        public static Array setSection_List​(Array a,
                                            List<List<Integer>> ranges,
                                            Array v)
        Set section
        参数:
        a - Array a
        ranges - Ranges
        v - Array value
        返回:
        Result array
      • flip

        public static Array flip​(Array a,
                                 List<Integer> idxs)
        Flip array
        参数:
        a - Array a
        idxs - Dimension index list
        返回:
        Result array
      • flip

        public static Array flip​(Array a,
                                 int idx)
        Flip array
        参数:
        a - Array a
        idx - Dimension idex
        返回:
        Result array
      • transpose

        public static Array transpose​(Array a,
                                      int dim1,
                                      int dim2)
        Transpose array
        参数:
        a - Array a
        dim1 - Dimension index 1
        dim2 - Dimension index 2
        返回:
        Result array
      • rot90

        public static Array rot90​(Array a,
                                  int k)
        Rotate an array by 90 degrees in counter-clockwise direction.
        参数:
        a - The array
        k - Rotate times
        返回:
        Rotated array
      • join

        public static Array join​(Array a,
                                 Array b,
                                 int dim)
        Join two arrays by a dimension
        参数:
        a - Array a
        b - Array b
        dim - Dimension for join
        返回:
        Joined array
      • getMinimum

        public static double getMinimum​(Array a)
        Get minimum value
        参数:
        a - Array a
        返回:
        Minimum value
      • getMaximum

        public static double getMaximum​(Array a)
        Get maximum value
        参数:
        a - Array a
        返回:
        Maximum value
      • getMinimum

        public static double getMinimum​(Array a,
                                        double missingv)
        Get minimum value
        参数:
        a - Array a
        missingv - Missing value
        返回:
        Minimum value
      • getMaximum

        public static double getMaximum​(Array a,
                                        double missingv)
        Get maximum value
        参数:
        a - Array a
        missingv - Missing value
        返回:
        Maximum value
      • min

        public static Number min​(Array a)
        Compute minimum value of an array
        参数:
        a - Array a
        返回:
        Minimum value
      • max

        public static Number max​(Array a)
        Compute maximum value of an array
        参数:
        a - Array a
        返回:
        Maximum value
      • sum

        public static Array sum​(List<Array> alist)
        Compute the sum arry from a list of arrays
        参数:
        alist - list of arrays
        返回:
        Sum array
      • sum

        public static Number sum​(Array a)
        Summarize array
        参数:
        a - Array a
        返回:
        Summarize value
      • sum

        public static double sum​(Array a,
                                 double missingValue)
        Summarize array skip missing value
        参数:
        a - Array a
        missingValue - Missing value
        返回:
        Summarize value
      • binCount

        public static Array binCount​(Array a)
        Count number of occurrences of each value in array of non-negative ints
        参数:
        a - The array
        返回:
        The result of binning the input array
      • binCount

        public static Array binCount​(Array a,
                                     Array weights)
        Count number of occurrences of each value in array of non-negative ints
        参数:
        a - The array
        weights - The weights
        返回:
        The result of binning the input array
      • prodDouble

        public static double prodDouble​(Array a)
        Produce array
        参数:
        a - Array a
        返回:
        Produce value
      • aveDouble

        public static double aveDouble​(Array a)
        Average array
        参数:
        a - Array a
        返回:
        Average value
      • aveDouble

        public static double aveDouble​(Array a,
                                       double missingValue)
        Average array skip missing value
        参数:
        a - Array a
        missingValue - Missing value
        返回:
        Average value
      • mean

        public static double mean​(Array a)
        Compute mean value of an array
        参数:
        a - Array a
        返回:
        Mean value
      • mean

        public static Array mean​(List<Array> alist)
        Compute the arithmetic mean arry from a list of arrays
        参数:
        alist - list of arrays
        返回:
        Mean array
      • std

        public static Array std​(Array a,
                                int axis,
                                int ddof)
                         throws InvalidRangeException
        Compute standard deviation value of an array along an axis (dimension)
        参数:
        a - Array a
        axis - Axis
        ddof - Means delta degree of freedom
        返回:
        Standard deviation value array
        抛出:
        InvalidRangeException
      • std

        public static double std​(Array a,
                                 List<Range> ranges,
                                 int ddof)
                          throws InvalidRangeException
        Compute standard deviation value of an array
        参数:
        a - Array a
        ranges - Range list
        ddof - Means delta degree of freedom
        返回:
        Standard deviation value
        抛出:
        InvalidRangeException
      • std

        public static double std​(Array a,
                                 int ddof)
                          throws InvalidRangeException
        Compute standard deviation value of an array
        参数:
        a - Array a
        ddof - Means delta degree of freedom
        返回:
        Standard deviation value
        抛出:
        InvalidRangeException
      • var

        public static Array var​(Array a,
                                int axis,
                                int ddof)
                         throws InvalidRangeException
        Compute variance value of an array along an axis (dimension)
        参数:
        a - Array a
        axis - Axis
        ddof - Means delta degree of freedom
        返回:
        Variance value array
        抛出:
        InvalidRangeException
      • median

        public static double median​(List<Double> aDataList)
        Median funtion
        参数:
        aDataList - The data list
        返回:
        Median
      • minimum

        public static double minimum​(List<Double> aDataList)
        Minimum function
        参数:
        aDataList - The data list
        返回:
        Minimum
      • maximum

        public static double maximum​(List<Double> aDataList)
        Maximum function
        参数:
        aDataList - The data list
        返回:
        Maximum
      • quantile

        public static double quantile​(List<Double> aDataList,
                                      int aNum)
        Quantile function
        参数:
        aDataList - The data list
        aNum - Quantile index
        返回:
        Quantile value
      • quantile

        public static double quantile​(Array a,
                                      int aNum)
        Quantile function
        参数:
        a - The data array
        aNum - Quantile index
        返回:
        Quantile value
      • median

        public static double median​(Array a)
        Compute median value of an array
        参数:
        a - Array a
        返回:
        Median value
      • maximum

        public static Array maximum​(Array x1,
                                    Array x2)
        Element-wise maximum of array elements.
        参数:
        x1 - Array 1
        x2 - Array 2
        返回:
        The maximum of x1 and x2, element-wise.
      • fmax

        public static Array fmax​(Array x1,
                                 Array x2)
        Element-wise maximum of array elements, ignores NaNs.
        参数:
        x1 - Array 1
        x2 - Array 2
        返回:
        The maximum of x1 and x2, element-wise.
      • minimum

        public static Array minimum​(Array x1,
                                    Array x2)
        Element-wise minimum of array elements.
        参数:
        x1 - Array 1
        x2 - Array 2
        返回:
        The minimum of x1 and x2, element-wise.
      • fmin

        public static Array fmin​(Array x1,
                                 Array x2)
        Element-wise minimum of array elements, ignores NaNs.
        参数:
        x1 - Array 1
        x2 - Array 2
        返回:
        The minimum of x1 and x2, element-wise.
      • rolling_mean

        public static Array rolling_mean​(Array x,
                                         int window,
                                         boolean center)
        Moving average function
        参数:
        x - The data array
        window - Size of moving window
        center - Set the data in center moving window
        返回:
        Moving averaged array
      • missingToNaN

        public static void missingToNaN​(Array a,
                                        Number missingv)
        Set missing value to NaN
        参数:
        a - Array a
        missingv - Missing value
      • setValue

        public static void setValue​(Array a,
                                    Array b,
                                    Number value)
        Set value
        参数:
        a - Array a
        b - Array b - 0/1 data
        value - Value
      • setValue

        public static void setValue​(Array a,
                                    Array b,
                                    Array value)
        Set value
        参数:
        a - Array a
        b - Array b - 0/1 data
        value - Value array
      • place

        public static void place​(Array a,
                                 Array b,
                                 Array value)
        Change elements of an array based on conditional and input values.
        参数:
        a - Array a
        b - Array b - 0/1 data
        value - Value array
      • replaceValue

        public static void replaceValue​(Array a,
                                        Object oValue,
                                        Object value)
        Replace value
        参数:
        a - Array a
        oValue - Replaced value
        value - New value
      • asList

        public static List<Object> asList​(Array a)
        As number list
        参数:
        a - Array a
        返回:
        Result number list
      • doubleToNumber

        public static Number doubleToNumber​(double v,
                                            DataType dt)
        Convert double to number by data type
        参数:
        v - Double value
        dt - Data type
        返回:
        Number
      • maskout

        public static Array maskout​(Array a,
                                    Array m,
                                    Number missingValue)
        Maskout function
        参数:
        a - Array a
        m - Array mask
        missingValue - Missing value
        返回:
        Result array
      • maskout

        public static Array maskout​(Array a,
                                    Array m)
        Maskout function
        参数:
        a - Array a
        m - Array mask
        返回:
        Result array
      • maskin

        public static Array maskin​(Array a,
                                   Array m)
        Maskin function
        参数:
        a - Array a
        m - Array mask
        返回:
        Result array
      • getR

        public static float getR​(List<Number> xData,
                                 List<Number> yData)
        Get correlation coefficient How well did the forecast values correspond to the observed values? Range: -1 to 1. Perfect score: 1.
        参数:
        xData - X data array
        yData - Y data array
        返回:
        Correlation coefficent
      • getR

        public static float getR​(Array xData,
                                 Array yData)
        Get correlation coefficient How well did the forecast values correspond to the observed values? Range: -1 to 1. Perfect score: 1.
        参数:
        xData - X data array
        yData - Y data array
        返回:
        Correlation coefficent
      • leastSquareTrend

        public static double[] leastSquareTrend​(List<Number> xData,
                                                List<Number> yData)
        Determine the least square trend equation - linear fitting
        参数:
        xData - X data array
        yData - Y data array
        返回:
        Result array - y intercept and slope
      • lineRegress

        public static double[] lineRegress​(List<Number> xData,
                                           List<Number> yData)
        Linear regress
        参数:
        xData - X data array
        yData - Y data array
        返回:
        Result array - y intercept, slope and correlation coefficent
      • lineRegress

        public static double[] lineRegress​(Array xData,
                                           Array yData)
        Linear regress
        参数:
        xData - X data array
        yData - Y data array
        返回:
        Slope, intercept, correlation coefficent, two-sided p-value, the standard error of the estimate for the slope, valid data number
      • polyVal

        public static Array polyVal​(List<Number> p,
                                    Array x)
        Evaluate a polynomial at specific values. If p is of length N, this function returns the value: p[0]*x**(N-1) + p[1]*x**(N-2) + ... + p[N-2]*x + p[N-1]
        参数:
        p - array_like or poly1d object
        x - array_like or poly1d object
        返回:
        ndarray or poly1d
      • cdiff

        public static Array cdiff​(Array data,
                                  int dimIdx)
        Performs a centered difference operation on a grid data along one dimension direction
        参数:
        data - The grid data
        dimIdx - Direction dimension index
        返回:
        Result grid data
      • cdiff_bak

        public static Array cdiff_bak​(Array data,
                                      boolean isX)
        Performs a centered difference operation on a grid data in the x or y direction
        参数:
        data - The grid data
        isX - If is x direction
        返回:
        Result grid data
      • hcurl

        public static Array hcurl​(Array uData,
                                  Array vData,
                                  List<Number> xx,
                                  List<Number> yy)
        Calculates the vertical component of the curl (ie, vorticity)
        参数:
        uData - U component
        vData - V component
        xx - X dimension value
        yy - Y dimension value
        返回:
        Curl
      • hcurl

        public static Array hcurl​(Array uData,
                                  Array vData,
                                  Array xx,
                                  Array yy)
        Calculates the vertical component of the curl (ie, vorticity)
        参数:
        uData - U component
        vData - V component
        xx - X dimension value
        yy - Y dimension value
        返回:
        Curl
      • hdivg

        public static Array hdivg​(Array uData,
                                  Array vData,
                                  List<Number> xx,
                                  List<Number> yy)
        Calculates the horizontal divergence using finite differencing
        参数:
        uData - U component
        vData - V component
        xx - X dimension value
        yy - Y dimension value
        返回:
        Divergence
      • hdivg

        public static Array hdivg​(Array uData,
                                  Array vData,
                                  Array xx,
                                  Array yy)
        Calculates the horizontal divergence using finite differencing
        参数:
        uData - U component
        vData - V component
        xx - X dimension value
        yy - Y dimension value
        返回:
        Divergence
      • magnitude

        public static Array magnitude​(Array uData,
                                      Array vData)
        Take magnitude value from U/V grid data
        参数:
        uData - U grid data
        vData - V grid data
        返回:
        Magnitude grid data