Iterable<DoubleColumn>
, Comparator<DoubleColumn>
, NumericColumn<DoubleColumn>
, Column<DoubleColumn>
, NumberFillers<DoubleColumn>
, NumberFilters
, NumberMapFunctions
, FilterSpec<DoubleColumn>
, NumberFilterSpec<DoubleColumn>
public class DoubleColumn extends NumberColumn<DoubleColumn,Double> implements NumberFillers<DoubleColumn>
Modifier and Type | Field | Description |
---|---|---|
protected it.unimi.dsi.fastutil.doubles.DoubleArrayList |
data |
DEFAULT_ARRAY_SIZE
comparator, locale
Modifier | Constructor | Description |
---|---|---|
protected |
DoubleColumn(String name) |
|
protected |
DoubleColumn(String name,
it.unimi.dsi.fastutil.doubles.DoubleArrayList data) |
Modifier and Type | Method | Description |
---|---|---|
DoubleColumn |
append(double d) |
Adds the given double to this column
|
DoubleColumn |
append(float f) |
Adds the given float to this column
|
DoubleColumn |
append(int i) |
|
DoubleColumn |
append(Double val) |
Appends value to the bottom of this column and return this column
|
DoubleColumn |
append(Number val) |
|
DoubleColumn |
append(Column<Double> column) |
Appends all the values in the argument to the bottom of this column and return this column
|
DoubleColumn |
append(Column<Double> column,
int row) |
Appends the value at the given row in the given column to the bottom of this column and return
this column
|
DoubleColumn |
appendCell(String value) |
Add one element to the bottom of this column and set its value to the parsed value of the given
String.
|
DoubleColumn |
appendCell(String value,
AbstractColumnParser<?> parser) |
Add one element to the bottom of this column and set its value to the parsed value of the given
String, as performed by the given parser
|
DoubleColumn |
appendMissing() |
Appends a missing value appropriate to the column
|
DoubleColumn |
appendObj(Object obj) |
Appends the given value to the bottom of this column and return this column
|
byte[] |
asBytes(int rowNumber) |
Returns the contents of the cell at rowNumber as a byte[].
|
double[] |
asDoubleArray() |
|
FloatColumn |
asFloatColumn() |
Returns a new FloatColumn containing a value for each value in this column, truncating if
necessary.
|
IntColumn |
asIntColumn() |
Returns a new IntColumn containing a value for each value in this column, truncating if
necessary.
|
LongColumn |
asLongColumn() |
Returns a new LongColumn containing a value for each value in this column, truncating if
necessary
|
Double[] |
asObjectArray() |
Returns an array of objects as appropriate for my type of column
|
Set<Double> |
asSet() |
Returns a Set containing all the unique values in this column
|
ShortColumn |
asShortColumn() |
Returns a new ShortColumn containing a value for each value in this column, truncating if
necessary.
|
DoubleColumn |
bottom(int n) |
Returns the smallest ("bottom") n values in the column TODO(lwhite): Consider whether this
should exclude missing
|
void |
clear() |
Removes all elements TODO: Make this return this column
|
int |
compare(Double o1,
Double o2) |
|
DoubleColumn |
copy() |
Returns a deep copy of the receiver
|
int |
countUnique() |
Returns the count of unique values in this column.
|
static DoubleColumn |
create(String name) |
|
static DoubleColumn |
create(String name,
double... arr) |
|
static DoubleColumn |
create(String name,
float... arr) |
|
static DoubleColumn |
create(String name,
int initialSize) |
|
static DoubleColumn |
create(String name,
int... arr) |
|
static DoubleColumn |
create(String name,
long... arr) |
|
static DoubleColumn |
create(String name,
Number[] numbers) |
|
static DoubleColumn |
create(String name,
Collection<? extends Number> numberList) |
|
static DoubleColumn |
create(String name,
DoubleStream stream) |
|
DoubleColumn |
createCol(String name) |
|
DoubleColumn |
createCol(String name,
int initialSize) |
|
boolean |
equals(int rowNumber1,
int rowNumber2) |
Returns true if the value in this column at rowNumber1 is equal to the value at rowNumber2
|
DoubleColumn |
fillWith(double d) |
|
DoubleColumn |
fillWith(it.unimi.dsi.fastutil.doubles.DoubleIterator iterator) |
|
DoubleColumn |
fillWith(DoubleSupplier supplier) |
|
DoubleColumn |
fillWith(DoubleRangeIterable iterable) |
|
DoubleColumn |
filter(DoublePredicate test) |
Returns a new NumberColumn with only those rows satisfying the predicate
|
Double |
get(int index) |
Returns the value at the given zero-based index
|
double |
getDouble(int row) |
Returns a double representation of the number at
index |
String |
getString(int row) |
Returns a string representation of the value at the given row.
|
String |
getUnformattedString(int row) |
Returns a String representation of the value at index r, without any formatting applied
|
Selection |
isIn(double... doubles) |
|
boolean |
isMissing(int rowNumber) |
Returns true if the value at rowNumber is missing
|
boolean |
isMissingValue(double value) |
|
Selection |
isNotIn(double... doubles) |
|
Iterator<Double> |
iterator() |
|
DoubleColumn |
lag(int n) |
Returns a column of the same type and size as the receiver, containing the receivers values
offset by n.
|
DoubleColumn |
removeMissing() |
Returns a copy of this column with the missing values removed
|
DoubleColumn |
set(int i,
double val) |
|
DoubleColumn |
set(int i,
Double val) |
Sets the value at index row to the given value and return this column
|
Column<Double> |
set(int row,
String stringValue,
AbstractColumnParser<?> parser) |
Sets the value at row to the parsed value of the given String using the given parser and
returns this column
|
DoubleColumn |
set(int row,
Column<Double> column,
int sourceRow) |
Sets the value at row to the value at sourceRow in the given column and return this column
|
DoubleColumn |
set(DoublePredicate condition,
NumericColumn<?> other) |
Updates this column where values matching the selection are replaced with the corresponding
value from the given column
|
DoubleColumn |
setMissing(int index) |
Sets the value at index i to the missing-value indicator for this column type, and return this
column
|
int |
size() |
Returns the number of elements in this column, including missing values
|
void |
sortAscending() |
Sorts my values in ascending order
|
void |
sortDescending() |
Sorts my values in descending order
|
DoubleColumn |
subset(int[] rows) |
Return a column of the same type containing just those elements whose indexes are included in
the given array
|
DoubleColumn |
top(int n) |
Returns the largest ("top") n values in the column TODO(lwhite): Consider whether this should
exclude missing
|
DoubleColumn |
unique() |
Returns a column of the same type containing only the unique values
|
int |
valueHash(int rowNumber) |
Returns an int suitable as a hash for the value in this column at the given index
|
static boolean |
valueIsMissing(double value) |
|
DoubleColumn |
where(Selection selection) |
Returns the subset of data in this column included in the given
Selection |
asStringColumn, filter, first, indexOf, inRange, last, map, max, min, name, parser, sampleN, sampleX, set, set, setName, setParser, sorted, toString, type
allMatch, anyMatch, asList, columnWidth, contains, count, count, filter, first, indexOf, inRange, last, map, map, mapInto, max, max, min, min, name, noneMatch, parser, print, reduce, reduce, sampleN, sampleX, set, set, set, setMissingTo, setName, setParser, sorted, title, type
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
forEach, spliterator
byteSize, countMissing, emptyCopy, emptyCopy, getPrintFormatter, rowComparator, set, set, setPrintFormatter, setPrintFormatter
isBetweenExclusive, isBetweenInclusive, isCloseTo, isEqualTo, isEqualTo, isGreaterThan, isGreaterThan, isGreaterThanOrEqualTo, isGreaterThanOrEqualTo, isLessThan, isLessThan, isLessThanOrEqualTo, isLessThanOrEqualTo, isNegative, isNonNegative, isNotEqualTo, isNotEqualTo, isPositive, isZero
abs, add, add, add, asPercent, asRatio, bin, cube, cubeRoot, cumMax, cumMin, cumProd, cumSum, difference, divide, divide, divide, log10, log1p, logN, multiply, multiply, multiply, name, neg, normalize, pctChange, power, power, reciprocal, remainder, remainder, round, roundInt, sqrt, square, subtract, subtract, subtract
allMatch, anyMatch, asDoubleColumn, asStringColumn, autoCorrelation, autoCorrelation, count, count, eval, eval, geometricMean, interpolate, isEmpty, isIn, isMissing, isNotIn, isNotMissing, kendalls, kurtosis, lead, mapInto, max, max, mean, median, min, min, noneMatch, pctChange, pearsons, percentile, populationVariance, product, quadraticMean, quartile1, quartile3, range, reduce, reduce, rolling, skewness, spearmans, standardDeviation, stats, sum, summarize, summary, sumOfLogs, sumOfSquares, variance
protected DoubleColumn(String name, it.unimi.dsi.fastutil.doubles.DoubleArrayList data)
protected DoubleColumn(String name)
public static boolean valueIsMissing(double value)
public String getString(int row)
getString
in interface Column<DoubleColumn>
getString
in class NumberColumn<DoubleColumn,Double>
row
- The index of the row.public int size()
size
in interface Column<DoubleColumn>
size
in interface NumberFilters
size
in interface NumberMapFunctions
public void clear()
clear
in interface Column<DoubleColumn>
public DoubleColumn setMissing(int index)
setMissing
in interface Column<DoubleColumn>
public static DoubleColumn create(String name, double... arr)
public static DoubleColumn create(String name)
public static DoubleColumn create(String name, float... arr)
public static DoubleColumn create(String name, int... arr)
public static DoubleColumn create(String name, long... arr)
public static DoubleColumn create(String name, Collection<? extends Number> numberList)
public static DoubleColumn create(String name, Number[] numbers)
public static DoubleColumn create(String name, int initialSize)
public static DoubleColumn create(String name, DoubleStream stream)
public DoubleColumn createCol(String name, int initialSize)
createCol
in class NumberColumn<DoubleColumn,Double>
public DoubleColumn createCol(String name)
createCol
in class NumberColumn<DoubleColumn,Double>
public Double get(int index)
get
in interface Column<DoubleColumn>
public DoubleColumn where(Selection selection)
Selection
where
in interface Column<DoubleColumn>
where
in interface NumericColumn<DoubleColumn>
public Selection isNotIn(double... doubles)
public Selection isIn(double... doubles)
public DoubleColumn subset(int[] rows)
subset
in interface Column<DoubleColumn>
subset
in class AbstractColumn<DoubleColumn,Double>
public DoubleColumn unique()
unique
in interface Column<DoubleColumn>
Column
public DoubleColumn top(int n)
top
in class NumberColumn<DoubleColumn,Double>
n
- The maximum number of records to return. The actual number will be smaller if n is
greater than the number of observations in the columnpublic DoubleColumn bottom(int n)
bottom
in class NumberColumn<DoubleColumn,Double>
n
- The maximum number of records to return. The actual number will be smaller if n is
greater than the number of observations in the columnpublic DoubleColumn lag(int n)
For example if you lag a column containing 2, 3, 4 by 1, you get a column containing NA, 2, 3
lag
in interface Column<DoubleColumn>
lag
in interface NumericColumn<DoubleColumn>
public DoubleColumn removeMissing()
removeMissing
in interface Column<DoubleColumn>
public DoubleColumn append(float f)
public DoubleColumn append(double d)
public DoubleColumn append(int i)
public int valueHash(int rowNumber)
valueHash
in interface Column<DoubleColumn>
public boolean equals(int rowNumber1, int rowNumber2)
equals
in interface Column<DoubleColumn>
public DoubleColumn append(Double val)
append
in interface Column<DoubleColumn>
public DoubleColumn append(Number val)
public DoubleColumn copy()
copy
in interface Column<DoubleColumn>
copy
in interface NumericColumn<DoubleColumn>
Column
public Iterator<Double> iterator()
iterator
in interface Iterable<DoubleColumn>
public double[] asDoubleArray()
NumericColumn
asDoubleArray
in interface NumberMapFunctions
asDoubleArray
in interface NumericColumn<DoubleColumn>
public Double[] asObjectArray()
asObjectArray
in interface Column<DoubleColumn>
public int compare(Double o1, Double o2)
compare
in interface Comparator<DoubleColumn>
public DoubleColumn set(int i, Double val)
set
in interface Column<DoubleColumn>
public DoubleColumn set(int i, double val)
public DoubleColumn set(DoublePredicate condition, NumericColumn<?> other)
public Column<Double> set(int row, String stringValue, AbstractColumnParser<?> parser)
set
in interface Column<DoubleColumn>
public DoubleColumn append(Column<Double> column)
append
in interface Column<DoubleColumn>
public DoubleColumn append(Column<Double> column, int row)
append
in interface Column<DoubleColumn>
public DoubleColumn set(int row, Column<Double> column, int sourceRow)
set
in interface Column<DoubleColumn>
public DoubleColumn filter(DoublePredicate test)
test
- the predicatepublic byte[] asBytes(int rowNumber)
asBytes
in interface Column<DoubleColumn>
rowNumber
- index of the rowpublic Set<Double> asSet()
asSet
in interface Column<DoubleColumn>
public int countUnique()
countUnique
in interface Column<DoubleColumn>
public double getDouble(int row)
index
getDouble
in interface NumberFilters
getDouble
in interface NumberMapFunctions
getDouble
in interface NumericColumn<DoubleColumn>
public boolean isMissingValue(double value)
public boolean isMissing(int rowNumber)
isMissing
in interface Column<DoubleColumn>
isMissing
in interface NumberMapFunctions
public void sortAscending()
sortAscending
in interface Column<DoubleColumn>
public void sortDescending()
sortDescending
in interface Column<DoubleColumn>
public DoubleColumn appendMissing()
appendMissing
in interface Column<DoubleColumn>
public DoubleColumn appendObj(Object obj)
appendObj
in interface Column<DoubleColumn>
public DoubleColumn appendCell(String value)
appendCell
in interface Column<DoubleColumn>
public DoubleColumn appendCell(String value, AbstractColumnParser<?> parser)
appendCell
in interface Column<DoubleColumn>
public String getUnformattedString(int row)
getUnformattedString
in interface Column<DoubleColumn>
public DoubleColumn fillWith(it.unimi.dsi.fastutil.doubles.DoubleIterator iterator)
fillWith
in interface NumberFillers<DoubleColumn>
public DoubleColumn fillWith(DoubleRangeIterable iterable)
fillWith
in interface NumberFillers<DoubleColumn>
public DoubleColumn fillWith(DoubleSupplier supplier)
fillWith
in interface NumberFillers<DoubleColumn>
public DoubleColumn fillWith(double d)
fillWith
in interface NumberFillers<DoubleColumn>
public LongColumn asLongColumn()
A narrowing primitive conversion such as this one may lose information about the overall magnitude of a numeric value and may also lose precision and range. Specifically, if the value is too small (a negative value of large magnitude or negative infinity), the result is the smallest representable value of type long.
Similarly, if the value is too large (a positive value of large magnitude or positive infinity), the result is the largest representable value of type long.
Despite the fact that overflow, underflow, or other loss of information may occur, a narrowing primitive conversion never results in a run-time exception.
A missing value in the receiver is converted to a missing value in the result
asLongColumn
in interface NumericColumn<DoubleColumn>
public IntColumn asIntColumn()
A narrowing primitive conversion such as this one may lose information about the overall magnitude of a numeric value and may also lose precision and range. Specifically, if the value is too small (a negative value of large magnitude or negative infinity), the result is the smallest representable value of type int.
Similarly, if the value is too large (a positive value of large magnitude or positive infinity), the result is the largest representable value of type int.
Despite the fact that overflow, underflow, or other loss of information may occur, a narrowing primitive conversion never results in a run-time exception.
A missing value in the receiver is converted to a missing value in the result
asIntColumn
in interface NumericColumn<DoubleColumn>
public ShortColumn asShortColumn()
A narrowing primitive conversion such as this one may lose information about the overall magnitude of a numeric value and may also lose precision and range. Specifically, if the value is too small (a negative value of large magnitude or negative infinity), the result is the smallest representable value of type int.
Similarly, if the value is too large (a positive value of large magnitude or positive infinity), the result is the largest representable value of type short.
Despite the fact that overflow, underflow, or other loss of information may occur, a narrowing primitive conversion never results in a run-time exception.
A missing value in the receiver is converted to a missing value in the result
asShortColumn
in interface NumericColumn<DoubleColumn>
public FloatColumn asFloatColumn()
A narrowing primitive conversion such as this one may lose information about the overall magnitude of a numeric value and may also lose precision and range. Specifically, if the value is too small (a negative value of large magnitude or negative infinity), the result is the smallest representable value of type float.
Similarly, if the value is too large (a positive value of large magnitude or positive infinity), the result is the largest representable value of type float.
Despite the fact that overflow, underflow, or other loss of information may occur, a narrowing primitive conversion never results in a run-time exception.
A missing value in the receiver is converted to a missing value in the result
asFloatColumn
in interface NumericColumn<DoubleColumn>
Copyright © 2022. All rights reserved.