Class NumberVector<T extends Number>

Type Parameters:
T - a subclass of Number.
All Implemented Interfaces:
Serializable, ValueVector

public class NumberVector<T extends Number> extends ObjectVector<T>
A number object vector.
See Also:
  • Constructor Details

    • NumberVector

      public NumberVector(StructField field, T[] vector)
      Constructor.
      Parameters:
      field - the struct field of vector.
      vector - the elements of vector.
  • Method Details

    • mean

      public double mean()
      Returns the mean.
    • stdev

      public double stdev()
      Returns the standard deviation.
    • min

      public double min()
      Returns the minimal value.
    • max

      public double max()
      Returns the maximal value.
    • median

      public double median()
      Returns the median.
    • q1

      public double q1()
      Returns the 25% quantile.
    • q3

      public double q3()
      Returns the 75% quantile.
    • fillna

      public void fillna(double value)
      Fills null/NaN/Inf values with the specified value.
      Parameters:
      value - the value to replace NAs.
    • get

      public NumberVector<T> get(Index index)
      Description copied from interface: ValueVector
      Returns a new vector with selected entries.
      Specified by:
      get in interface ValueVector
      Overrides:
      get in class ObjectVector<T extends Number>
      Parameters:
      index - the index of selected entries.
      Returns:
      the new vector of selected entries.
    • withName

      public NumberVector<T> withName(String name)
      Description copied from interface: ValueVector
      Returns the vector with the new name.
      Specified by:
      withName in interface ValueVector
      Overrides:
      withName in class ObjectVector<T extends Number>
      Parameters:
      name - the new name.
      Returns:
      the vector with the new name.
    • intStream

      public IntStream intStream()
      Description copied from interface: ValueVector
      Returns an IntStream consisting of the elements of this vector, converted to integer.
      Returns:
      an IntStream consisting of the elements of this vector.
    • longStream

      public LongStream longStream()
      Description copied from interface: ValueVector
      Returns a LongStream consisting of the elements of this vector, converted to long.
      Returns:
      a LongStream consisting of the elements of this vector.
    • doubleStream

      public DoubleStream doubleStream()
      Description copied from interface: ValueVector
      Returns a DoubleStream consisting of the elements of this vector, converted to double.
      Returns:
      a DoubleStream consisting of the elements of this vector.