public class DoubleColumn extends AbstractColumn<Double,DoubleColumn> implements NumberColumn
DEFAULT_ARRAY_SIZEMISSING_VALUE| Modifier and Type | Method and Description |
|---|---|
void |
append(Column column) |
DoubleColumn |
append(double d)
Adds the given double to this column
|
DoubleColumn |
append(float f)
Adds the given float to this column
|
DoubleColumn |
appendCell(String object) |
DoubleColumn |
appendCell(String object,
StringParser parser) |
DoubleColumn |
appendMissing()
Appends a missing value appropriate to the column
|
byte[] |
asBytes(int rowNumber)
Returns the contents of the cell at rowNumber as a byte[]
|
DateTimeColumn |
asDateTimes(ZoneOffset offset)
Returns a DateTimeColumn where each value is the LocalDateTime represented by the values in this column
The values in this column must be longs that represent the time in milliseconds from the epoch as in standard
Java date/time calculations
|
double[] |
asDoubleArray() |
int[] |
asIntArray() |
it.unimi.dsi.fastutil.ints.IntSet |
asIntegerSet() |
Object[] |
asObjectArray() |
it.unimi.dsi.fastutil.doubles.DoubleSet |
asSet() |
it.unimi.dsi.fastutil.doubles.DoubleArrayList |
bottom(int n)
Returns the smallest ("bottom") n values in the column
TODO(lwhite): Consider whether this should exclude missing
|
int |
byteSize()
Returns the width of a cell in this column, in bytes.
|
void |
clear() |
boolean |
contains(double value) |
NumberColumn |
copy()
Returns a deep copy of the receiver
|
static DoubleColumn |
create(String columnName) |
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,
List<Number> numberList) |
static DoubleColumn |
create(String name,
long[] arr) |
static DoubleColumn |
create(String name,
Number[] numbers) |
it.unimi.dsi.fastutil.doubles.DoubleList |
dataInternal()
Returns a clone of the internal data structure
|
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.
|
Selection |
eval(BiPredicate<Number,Number> predicate,
Number number) |
Selection |
eval(DoubleBiPredicate predicate,
Number number) |
Selection |
eval(DoubleBiPredicate predicate,
NumberColumn otherColumn) |
Selection |
eval(DoublePredicate predicate) |
Selection |
eval(DoubleRangePredicate predicate,
Number rangeStart,
Number rangeEnd) |
DoubleColumn |
fillWith(it.unimi.dsi.fastutil.doubles.DoubleIterable iterable) |
DoubleColumn |
fillWith(it.unimi.dsi.fastutil.doubles.DoubleIterator iterator) |
DoubleColumn |
fillWith(DoubleSupplier supplier) |
double |
firstElement() |
double |
get(int index) |
double |
getDouble(int row)
Returns a double representation of the value at the given row.
|
long |
getLong(int i)
Returns the value of the ith element rounded to the nearest long
|
Double |
getObject(int index) |
String |
getString(int row)
Returns a string representation of the value at the given row.
|
String |
getUnformattedString(int row) |
static DoubleColumn |
indexColumn(String columnName,
int size,
int startsWith)
Returns a new numeric column initialized with the given name and size.
|
boolean |
isEmpty()
Returns true if the column has no data
|
Selection |
isIn(double... doubles) |
Selection |
isIn(Number... numbers) |
boolean |
isMissing(int rowNumber) |
Selection |
isNotIn(double... doubles) |
Selection |
isNotIn(Number... numbers) |
it.unimi.dsi.fastutil.doubles.DoubleIterator |
iterator() |
NumberColumn |
lag(int n)
Returns a column of the same type and size as the receiver, containing the receivers values offset by n.
|
NumberColumn |
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 |
removeMissing() |
Integer |
roundInt(int i)
Returns the rounded value as an int
|
it.unimi.dsi.fastutil.ints.IntComparator |
rowComparator()
Compares the given ints, which refer to the indexes of the doubles in this column, according to the values of the
doubles themselves
|
DoubleColumn |
set(int r,
double value) |
DoubleColumn |
set(int i,
Double val) |
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
|
void |
setPrintFormatter(NumberColumnFormatter formatter) |
void |
setPrintFormatter(NumberFormat format,
String missingValueString) |
int |
size() |
void |
sortAscending() |
void |
sortDescending() |
Stats |
stats() |
Table |
summary() |
it.unimi.dsi.fastutil.doubles.DoubleArrayList |
top(int n)
Returns the largest ("top") n values in the column
TODO(lwhite): Consider whether this should exclude missing
|
Column |
unique()
Returns a column of the same type as the receiver, containing only the unique values of the receiver.
|
NumberColumn |
where(Selection selection) |
columnWidth, fillMissing, fillMissing, name, print, setName, toString, typeclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcountMissing, countUnique, geometricMean, kendalls, kurtosis, max, mean, median, min, pearsons, percentile, populationVariance, product, quadraticMean, quartile1, quartile3, range, skewness, spearmans, standardDeviation, sum, sumOfLogs, sumOfSquares, valueIsMissing, varianceabs, add, add, add, asPercent, asRatio, bin, cube, cubeRoot, cumProd, cumSum, difference, divide, divide, divide, log10, log1p, logN, multiply, multiply, multiply, neg, normalize, pctChange, power, remainder, round, roundInt, sqrt, square, subtract, subtract, subtractspliteratorisBetweenExclusive, isBetweenInclusive, isCloseTo, isEqualTo, isEqualTo, isGreaterThan, isGreaterThan, isGreaterThanOrEqualTo, isGreaterThanOrEqualTo, isLessThan, isLessThan, isLessThanOrEqualTo, isLessThanOrEqualTo, isMissing, isNegative, isNonNegative, isNotEqualTo, isNotEqualTo, isNotMissing, isPositive, isZerocountByCategorypublic static DoubleColumn create(String name, int initialSize)
public static DoubleColumn create(String name, double[] arr)
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 DoubleColumn removeMissing()
removeMissing in interface Columnpublic static DoubleColumn indexColumn(String columnName, int size, int startsWith)
public static DoubleColumn create(String columnName)
public boolean isMissing(int rowNumber)
isMissing in interface NumberColumnisMissing in interface Columnpublic void setPrintFormatter(NumberFormat format, String missingValueString)
setPrintFormatter in interface NumberColumnpublic DoubleColumn appendMissing()
ColumnappendMissing in interface NumberColumnappendMissing in interface Columnpublic void setPrintFormatter(NumberColumnFormatter formatter)
setPrintFormatter in interface NumberColumnpublic int size()
size in interface NumberColumnsize in interface Columnpublic Table summary()
summary in interface NumberColumnsummary in interface Columnpublic Stats stats()
stats in interface NumberColumnpublic it.unimi.dsi.fastutil.doubles.DoubleArrayList top(int n)
top in interface NumberColumnn - 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 it.unimi.dsi.fastutil.doubles.DoubleArrayList bottom(int n)
bottom in interface NumberColumnn - 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 Column unique()
Columnunique in interface NumberColumnunique in interface ColumnColumnpublic double firstElement()
firstElement in interface NumberColumnpublic DoubleColumn append(float f)
append in interface NumberColumnpublic DoubleColumn append(double d)
append in interface NumberColumnpublic String getString(int row)
ColumngetString in interface NumberColumngetString in interface Columnrow - The index of the row.public double getDouble(int row)
ColumngetDouble in interface NumberColumngetDouble in interface Columnrow - The index of the row.public String getUnformattedString(int row)
getUnformattedString in interface NumberColumngetUnformattedString in interface Columnpublic DoubleColumn emptyCopy()
ColumnemptyCopy in interface NumberColumnemptyCopy in interface ColumnemptyCopy in class AbstractColumn<Double,DoubleColumn>Columnpublic DoubleColumn emptyCopy(int rowSize)
ColumnemptyCopy in interface NumberColumnemptyCopy in interface ColumnrowSize - the initial row sizeColumnpublic NumberColumn lead(int n)
Columnlead in interface NumberColumnlead in interface Columnpublic NumberColumn lag(int n)
ColumnFor example if you lag a column containing 2, 3, 4 by 1, you get a column containing NA, 2, 3
lag in interface NumberColumnlag in interface Columnpublic NumberColumn copy()
Columncopy in interface NumberColumncopy in interface ColumnColumnpublic void clear()
clear in interface NumberColumnclear in interface Columnpublic void sortAscending()
sortAscending in interface NumberColumnsortAscending in interface Columnpublic void sortDescending()
sortDescending in interface NumberColumnsortDescending in interface Columnpublic boolean isEmpty()
ColumnisEmpty in interface NumberColumnisEmpty in interface Columnpublic DoubleColumn appendCell(String object)
appendCell in interface NumberColumnappendCell in interface Columnpublic DoubleColumn appendCell(String object, StringParser parser)
appendCell in interface Columnpublic Integer roundInt(int i)
roundInt in interface NumberColumnClassCastException - if the returned value will not fit in an intpublic long getLong(int i)
getLong in interface NumberColumni - the index in the columnpublic it.unimi.dsi.fastutil.ints.IntComparator rowComparator()
rowComparator in interface NumberColumnrowComparator in interface Columnpublic double get(int index)
get in interface NumberColumnget in interface NumberMapFunctionspublic DoubleColumn set(int r, double value)
set in interface NumberColumnpublic DoubleColumn set(int i, Double val)
set in class AbstractColumn<Double,DoubleColumn>public DoubleColumn set(Selection rowSelection, double newValue)
Example: myColumn.set(4.0, myColumn.valueIsMissing()); // no more missing values
set in interface NumberColumnpublic double[] asDoubleArray()
asDoubleArray in interface NumberColumnasDoubleArray in interface Columnpublic void append(Column column)
append in interface NumberColumnappend in interface Columnpublic it.unimi.dsi.fastutil.doubles.DoubleIterator iterator()
iterator in interface it.unimi.dsi.fastutil.doubles.DoubleIterableiterator in interface Iterable<Double>iterator in interface NumberColumnpublic NumberColumn where(Selection selection)
where in interface NumberColumnwhere in interface Columnpublic Selection eval(DoublePredicate predicate)
eval in interface NumberColumneval in interface NumberFilterspublic Selection eval(DoubleBiPredicate predicate, NumberColumn otherColumn)
eval in interface NumberColumneval in interface NumberFilterspublic Selection eval(DoubleBiPredicate predicate, Number number)
eval in interface NumberColumneval in interface NumberFilterspublic Selection eval(BiPredicate<Number,Number> predicate, Number number)
eval in interface NumberFilterspublic Selection eval(DoubleRangePredicate predicate, Number rangeStart, Number rangeEnd)
eval in interface NumberColumneval in interface NumberFilterspublic Selection isIn(Number... numbers)
isIn in interface NumberColumnisIn in interface NumberFilterspublic Selection isIn(double... doubles)
isIn in interface NumberFilterspublic Selection isNotIn(Number... numbers)
isNotIn in interface NumberColumnisNotIn in interface NumberFilterspublic Selection isNotIn(double... doubles)
isNotIn in interface NumberFilterspublic it.unimi.dsi.fastutil.doubles.DoubleSet asSet()
asSet in interface NumberColumnpublic boolean contains(double value)
contains in interface NumberColumnpublic int byteSize()
ColumnbyteSize in interface NumberColumnbyteSize in interface Columnpublic byte[] asBytes(int rowNumber)
asBytes in interface NumberColumnasBytes in interface ColumnrowNumber - index of the rowpublic int[] asIntArray()
asIntArray in interface CategoricalColumnasIntArray in interface NumberColumnpublic it.unimi.dsi.fastutil.ints.IntSet asIntegerSet()
asIntegerSet in interface CategoricalColumnpublic it.unimi.dsi.fastutil.doubles.DoubleList dataInternal()
NumberFiltersdataInternal in interface NumberColumndataInternal in interface NumberFilterspublic DateTimeColumn asDateTimes(ZoneOffset offset)
NumberColumnasDateTimes in interface NumberColumnoffset - The ZoneOffset to use in the calculationpublic DoubleColumn fillWith(it.unimi.dsi.fastutil.doubles.DoubleIterator iterator)
fillWith in interface NumberFillers<NumberColumn>public DoubleColumn fillWith(it.unimi.dsi.fastutil.doubles.DoubleIterable iterable)
fillWith in interface NumberFillers<NumberColumn>public DoubleColumn fillWith(DoubleSupplier supplier)
fillWith in interface NumberFillers<NumberColumn>public Object[] asObjectArray()
asObjectArray in interface Columnpublic Double getObject(int index)
getObject in interface ColumngetObject in class AbstractColumn<Double,DoubleColumn>Copyright © 2018. All rights reserved.