public class DoubleColumn extends NumberColumn<Double> implements NumberFillers<DoubleColumn>
comparator, locale
DEFAULT_ARRAY_SIZE
Modifier | Constructor and Description |
---|---|
protected |
DoubleColumn(String name) |
protected |
DoubleColumn(String name,
it.unimi.dsi.fastutil.doubles.DoubleArrayList data) |
Modifier and Type | Method and Description |
---|---|
DoubleColumn |
append(Column<Double> column) |
DoubleColumn |
append(Column<Double> column,
int row) |
DoubleColumn |
append(double d)
Adds the given double to this column
|
DoubleColumn |
append(Double val) |
DoubleColumn |
append(float f)
Adds the given float to this column
|
DoubleColumn |
append(int i) |
DoubleColumn |
append(Number val) |
DoubleColumn |
appendCell(String value) |
DoubleColumn |
appendCell(String value,
AbstractColumnParser<?> parser) |
DoubleColumn |
appendMissing()
Appends a missing value appropriate to the column
|
DoubleColumn |
appendObj(Object obj) |
byte[] |
asBytes(int rowNumber)
Returns the contents of the cell at rowNumber as a byte[]
|
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() |
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() |
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,
DoubleStream stream) |
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,
List<Number> numberList) |
static DoubleColumn |
create(String name,
long[] arr) |
static DoubleColumn |
create(String name,
Number[] numbers) |
DoubleColumn |
createCol(String name) |
DoubleColumn |
createCol(String name,
int initialSize) |
DoubleColumn |
emptyCopy()
Returns a copy of the receiver with no data.
|
DoubleColumn |
emptyCopy(int rowSize)
Returns an empty copy of the receiver, with its internal storage initialized to the given row
size.
|
DoubleColumn |
fillWith(double d) |
DoubleColumn |
fillWith(it.unimi.dsi.fastutil.doubles.DoubleIterator iterator) |
DoubleColumn |
fillWith(DoubleRangeIterable iterable) |
DoubleColumn |
fillWith(DoubleSupplier supplier) |
DoubleColumn |
filter(DoublePredicate test)
Returns a new NumberColumn with only those rows satisfying the predicate
|
DoubleColumn |
filter(Predicate<? super Double> test)
Returns a new Column of the same type with only those rows satisfying the predicate
|
DoubleColumn |
first(int numRows) |
Double |
get(int index) |
double |
getDouble(int row) |
String |
getString(int row)
Returns a string representation of the value at the given row.
|
String |
getUnformattedString(int row) |
DoubleColumn |
inRange(int start,
int end)
Returns a column containing the rows in this column beginning with start inclusive, and ending
with end exclusive
|
boolean |
isMissing(int rowNumber) |
boolean |
isMissingValue(double value) |
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 |
last(int numRows) |
DoubleColumn |
lead(int n)
Returns a column of the same type as the receiver, containing the receivers values offset -n
For example if you lead a column containing 2, 3, 4 by 1, you get a column containing 3, 4, NA.
|
DoubleColumn |
map(Function<? super Double,? extends Double> fun)
Maps the function across all rows, appending the results to a new Column of the same type
|
DoubleColumn |
max(Column<Double> other)
Returns a column containing the element-wise min between this column and other column
|
DoubleColumn |
min(Column<Double> other)
Returns a column containing the element-wise min between this column and other column
|
DoubleColumn |
removeMissing() |
DoubleColumn |
sampleN(int n)
Returns a column containing a random sample of the values in this column
|
DoubleColumn |
sampleX(double proportion)
Returns a table consisting of randomly selected values from this column.
|
DoubleColumn |
set(DoublePredicate condition,
Double newValue) |
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 |
set(int row,
Column<Double> column,
int sourceRow) |
DoubleColumn |
set(int i,
double val) |
DoubleColumn |
set(int i,
Double val) |
DoubleColumn |
set(Selection condition,
Column<Double> other)
Updates this column where values matching the selection are replaced with the corresponding
value from the given column
|
DoubleColumn |
set(Selection rowSelection,
Double newValue)
Conditionally update this column, replacing current values with newValue for all rows where the
current value matches the selection criteria
|
DoubleColumn |
setMissing(int index) |
DoubleColumn |
setName(String name)
Sets the columns name to the given string
|
int |
size() |
void |
sortAscending() |
void |
sortDescending() |
DoubleColumn |
sorted(Comparator<? super Double> comp)
Returns a new Column of the same type sorted according to the provided Comparator
|
DoubleColumn |
subset(int[] rows) |
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 as the receiver, containing only the unique values of the
receiver.
|
static boolean |
valueIsMissing(double value) |
DoubleColumn |
where(Selection selection) |
allMatch, anyMatch, byteSize, countMissing, getPrintFormatter, noneMatch, rowComparator, set, setPrintFormatter, setPrintFormatter
asStringColumn, name, toString, type
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
asDoubleArray, asDoubleColumn, asStringColumn, count, count, eval, eval, geometricMean, isEmpty, isIn, isIn, isMissing, isNotIn, isNotIn, isNotMissing, kendalls, kurtosis, mapInto, max, max, mean, median, min, min, pctChange, pearsons, percentile, populationVariance, product, quadraticMean, quartile1, quartile3, range, reduce, reduce, rolling, skewness, spearmans, standardDeviation, stats, sum, summarize, summary, sumOfLogs, sumOfSquares, variance
allMatch, anyMatch, asList, columnWidth, contains, count, count, mapInto, max, min, name, noneMatch, print, reduce, reduce, set, setMissingTo, title, type
forEach, spliterator
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
abs, add, add, add, asPercent, asRatio, bin, cube, cubeRoot, 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
isBetweenExclusive, isBetweenInclusive, isCloseTo, isEqualTo, isEqualTo, isGreaterThan, isGreaterThan, isGreaterThanOrEqualTo, isGreaterThanOrEqualTo, isLessThan, isLessThan, isLessThanOrEqualTo, isLessThanOrEqualTo, isNegative, isNonNegative, isNotEqualTo, isNotEqualTo, isPositive, isZero
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)
Column
public int size()
size
in interface Column<Double>
size
in interface NumberFilters
size
in interface NumberMapFunctions
public DoubleColumn setMissing(int index)
setMissing
in interface Column<Double>
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, List<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<Double>
public DoubleColumn createCol(String name)
createCol
in class NumberColumn<Double>
public DoubleColumn subset(int[] rows)
public DoubleColumn unique()
Column
public DoubleColumn top(int n)
NumberColumn
top
in class NumberColumn<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)
NumberColumn
bottom
in class NumberColumn<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)
Column
For example if you lag a column containing 2, 3, 4 by 1, you get a column containing NA, 2, 3
public DoubleColumn removeMissing()
removeMissing
in interface Column<Double>
public DoubleColumn append(float f)
public DoubleColumn append(double d)
public DoubleColumn append(int i)
public DoubleColumn append(Double val)
public DoubleColumn append(Number val)
public DoubleColumn emptyCopy()
Column
public DoubleColumn emptyCopy(int rowSize)
Column
public DoubleColumn copy()
Column
public Double[] asObjectArray()
asObjectArray
in interface Column<Double>
public int compare(Double o1, Double o2)
compare
in interface Comparator<Double>
public DoubleColumn set(int i, Double val)
public DoubleColumn set(int i, double val)
public DoubleColumn set(DoublePredicate condition, NumericColumn<?> other)
public DoubleColumn set(DoublePredicate condition, Double newValue)
set
in class NumberColumn<Double>
public DoubleColumn append(Column<Double> column)
public DoubleColumn append(Column<Double> column, int row)
public DoubleColumn set(int row, Column<Double> column, int sourceRow)
public DoubleColumn filter(DoublePredicate test)
test
- the predicatepublic byte[] asBytes(int rowNumber)
NumberColumn
public int countUnique()
Column
countUnique
in interface Column<Double>
public double getDouble(int row)
getDouble
in interface NumericColumn<Double>
getDouble
in interface NumberFilters
getDouble
in interface NumberMapFunctions
public boolean isMissingValue(double value)
public boolean isMissing(int rowNumber)
isMissing
in interface Column<Double>
isMissing
in interface NumberMapFunctions
public void sortAscending()
sortAscending
in interface Column<Double>
public void sortDescending()
sortDescending
in interface Column<Double>
public DoubleColumn appendMissing()
Column
appendMissing
in interface Column<Double>
appendMissing
in class NumberColumn<Double>
public DoubleColumn appendObj(Object obj)
public DoubleColumn appendCell(String value)
appendCell
in interface Column<Double>
public DoubleColumn appendCell(String value, AbstractColumnParser<?> parser)
appendCell
in interface Column<Double>
public String getUnformattedString(int row)
getUnformattedString
in interface Column<Double>
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 DoubleColumn inRange(int start, int end)
Column
public DoubleColumn where(Selection selection)
public DoubleColumn lead(int n)
Column
public DoubleColumn setName(String name)
Column
public DoubleColumn filter(Predicate<? super Double> test)
Column
public DoubleColumn sorted(Comparator<? super Double> comp)
Column
public DoubleColumn map(Function<? super Double,? extends Double> fun)
Column
public DoubleColumn min(Column<Double> other)
Column
TODO(lwhite) Override in column subtypes for better performance
public DoubleColumn max(Column<Double> other)
Column
TODO(lwhite) Override in column subtypes for better performance
public DoubleColumn set(Selection condition, Column<Double> other)
Column
public DoubleColumn set(Selection rowSelection, Double newValue)
Column
public DoubleColumn first(int numRows)
public DoubleColumn last(int numRows)
public DoubleColumn sampleN(int n)
Column
public DoubleColumn sampleX(double proportion)
Column
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<Double>
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<Double>
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<Double>
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<Double>
Copyright © 2019. All rights reserved.