public class DoubleColumn extends AbstractColumn implements it.unimi.dsi.fastutil.doubles.DoubleIterable, NumericColumn
Modifier and Type | Field and Description |
---|---|
static double |
MISSING_VALUE |
Constructor and Description |
---|
DoubleColumn(ColumnMetadata metadata) |
DoubleColumn(String name) |
DoubleColumn(String name,
double[] arr) |
DoubleColumn(String name,
int initialSize) |
Modifier and Type | Method and Description |
---|---|
DoubleColumn |
abs()
Returns a doubleColumn with the absolute value of each value in this column
|
void |
append(Column column) |
void |
append(double d)
Adds the given double to this column
|
void |
append(float f)
Adds the given float to this column
|
void |
appendCell(String object) |
byte[] |
asBytes(int rowNumber)
Returns the contents of the cell at rowNumber as a byte[]
|
double[] |
asDoubleArray() |
it.unimi.dsi.fastutil.doubles.DoubleArrayList |
bottom(int n)
Returns the smallest ("bottom") n values in the column
|
int |
byteSize()
Returns the width of a cell in this column, in bytes.
|
void |
clear() |
boolean |
contains(double value) |
static double |
convert(String stringValue)
Returns a double that is parsed from the given String
|
DoubleColumn |
copy()
Returns a deep copy of the receiver
|
int |
countMissing()
Returns the count of missing values in this column
|
int |
countUnique()
Returns the count of unique values in this column.
|
DoubleColumn |
cube() |
DoubleColumn |
cubeRoot() |
DoubleColumn |
cumProd()
Returns a new column with a cumulative product calculated
|
DoubleColumn |
cumSum()
Returns a new column with a cumulative sum calculated
|
it.unimi.dsi.fastutil.doubles.DoubleArrayList |
data() |
DoubleColumn |
difference()
Returns a new column of the same type as the receiver, such that the values in the new column
contain the difference between each cell in the original and it's predecessor.
|
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.
|
double |
firstElement() |
double |
geometricMean() |
double |
get(int index) |
double |
getDouble(int index)
Returns double value at
index position in the column. |
String |
getString(int row)
Returns a string representation of the value at the given row.
|
boolean |
isEmpty()
Returns true if the column has no data
|
Selection |
isEqualTo(double d) |
Selection |
isEqualTo(DoubleColumn d) |
Selection |
isGreaterThan(double f) |
Selection |
isGreaterThan(DoubleColumn d) |
Selection |
isGreaterThanOrEqualTo(double f) |
Selection |
isLessThan(double f) |
Selection |
isLessThan(DoubleColumn d) |
Selection |
isLessThanOrEqualTo(double f) |
Selection |
isMissing() |
protected static boolean |
isMissing(double value) |
Selection |
isNegative() |
Selection |
isNonNegative() |
Selection |
isNotEqualTo(double d) |
Selection |
isNotMissing() |
Selection |
isPositive() |
Selection |
isZero() |
it.unimi.dsi.fastutil.doubles.DoubleIterator |
iterator() |
double |
kurtosis() |
DoubleColumn |
log10()
Returns the base 10 log of the values in this column as a new DoubleColumn
|
DoubleColumn |
log1p()
Returns the natural log of the values in this column, after adding 1 to each so that zero
values don't return -Infinity
|
DoubleColumn |
logN()
Returns the natural log of the values in this column as a new DoubleColumn
|
double |
max() |
double |
mean() |
double |
median() |
double |
min() |
DoubleColumn |
neg()
For each item in the column, returns the same number with the sign changed.
|
DoubleColumn |
pctChange()
Returns a new column with a percent change calculated
|
double |
percentile(double percentile) |
double |
populationVariance() |
String |
print() |
double |
product() |
double |
quadraticMean()
Returns the quadraticMean, aka the root-mean-square, for all values in this column
|
double |
quartile1() |
double |
quartile3() |
double |
range() |
DoubleColumn |
remainder(DoubleColumn column2) |
DoubleColumn |
round() |
IntColumn |
roundInt()
Returns the rounded values as a IntColumn.
|
LongColumn |
roundLong()
Returns the rounded values as a LongColumn
|
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
|
Selection |
select(DoubleBiPredicate predicate,
double value) |
Selection |
select(DoublePredicate predicate) |
void |
set(double newValue,
Selection rowSelection)
Conditionally update this column, replacing current values with newValue for all rows where the current value
matches the selection criteria
Example:
myColumn.set(4.0, myColumn.isMissing()); // no more missing values
|
void |
set(int r,
double value) |
int |
size() |
double |
skewness() |
void |
sortAscending() |
void |
sortDescending() |
DoubleColumn |
sqrt() |
DoubleColumn |
square()
Returns a doubleColumn with the square of each value in this column
|
double |
standardDeviation() |
Stats |
stats() |
double |
sum() |
Table |
summary() |
double |
sumOfLogs() |
double |
sumOfSquares() |
it.unimi.dsi.fastutil.doubles.DoubleArrayList |
top(int n)
Returns the largest ("top") n values in the column
|
String |
toString() |
ColumnType |
type()
Returns this column's ColumnType
|
DoubleColumn |
unique()
Returns a column of the same type as the receiver, containing only the unique values of the receiver.
|
double |
variance() |
columnMetadata, columnWidth, comment, id, metadata, name, setComment, setName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
spliterator
add, add, addColumns, divide, divide, divideColumns, getFloat, getInt, getLong, multiply, multiply, multiplyColumns, subtract, subtract, subtractColumns
public DoubleColumn(String name)
public DoubleColumn(String name, int initialSize)
public DoubleColumn(String name, double[] arr)
public DoubleColumn(ColumnMetadata metadata)
protected static boolean isMissing(double value)
public static double convert(String stringValue)
We remove any commas before parsing
public Stats stats()
public int countUnique()
Column
countUnique
in interface Column
public it.unimi.dsi.fastutil.doubles.DoubleArrayList top(int n)
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 it.unimi.dsi.fastutil.doubles.DoubleArrayList bottom(int n)
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 unique()
Column
public it.unimi.dsi.fastutil.doubles.DoubleArrayList data()
public ColumnType type()
Column
type
in interface Column
ColumnType
public double firstElement()
public double sum()
public double product()
product
in interface NumericColumn
public double mean()
mean
in interface NumericColumn
public double median()
median
in interface NumericColumn
public double quartile1()
quartile1
in interface NumericColumn
public double quartile3()
quartile3
in interface NumericColumn
public double percentile(double percentile)
percentile
in interface NumericColumn
public double range()
range
in interface NumericColumn
public double max()
max
in interface NumericColumn
public double min()
min
in interface NumericColumn
public double variance()
variance
in interface NumericColumn
public double populationVariance()
populationVariance
in interface NumericColumn
public double standardDeviation()
standardDeviation
in interface NumericColumn
public double sumOfLogs()
sumOfLogs
in interface NumericColumn
public double sumOfSquares()
sumOfSquares
in interface NumericColumn
public double geometricMean()
geometricMean
in interface NumericColumn
public double quadraticMean()
quadraticMean
in interface NumericColumn
public double kurtosis()
kurtosis
in interface NumericColumn
public double skewness()
skewness
in interface NumericColumn
public void append(float f)
public void append(double d)
public Selection isLessThan(double f)
public Selection isNotMissing()
isNotMissing
in interface Column
public Selection isGreaterThan(double f)
public Selection isGreaterThanOrEqualTo(double f)
public Selection isLessThanOrEqualTo(double f)
public Selection isNotEqualTo(double d)
public Selection isEqualTo(double d)
public Selection isEqualTo(DoubleColumn d)
public Selection isGreaterThan(DoubleColumn d)
public Selection isLessThan(DoubleColumn d)
public String getString(int row)
Column
public DoubleColumn emptyCopy()
Column
public DoubleColumn emptyCopy(int rowSize)
Column
public DoubleColumn copy()
Column
public void sortAscending()
sortAscending
in interface Column
public void sortDescending()
sortDescending
in interface Column
public boolean isEmpty()
Column
public int countMissing()
countMissing
in interface Column
public void appendCell(String object)
appendCell
in interface Column
appendCell
in class AbstractColumn
public DoubleColumn logN()
public DoubleColumn log10()
public DoubleColumn log1p()
public DoubleColumn round()
public LongColumn roundLong()
public IntColumn roundInt()
ClassCastException
- if the returned value will not fit in an intpublic DoubleColumn abs()
public DoubleColumn square()
public DoubleColumn sqrt()
public DoubleColumn cubeRoot()
public DoubleColumn cube()
public DoubleColumn remainder(DoubleColumn column2)
public DoubleColumn neg()
public it.unimi.dsi.fastutil.ints.IntComparator rowComparator()
rowComparator
in interface Column
public double get(int index)
public double getDouble(int index)
NumericColumn
index
position in the column. A conversion, if needed, could result
in data or accuracy loss.getDouble
in interface NumericColumn
index
- position in columnpublic void set(int r, double value)
public void set(double newValue, Selection rowSelection)
public Selection isPositive()
public Selection isZero()
public Selection isNegative()
public Selection isNonNegative()
public double[] asDoubleArray()
asDoubleArray
in interface NumericColumn
asDoubleArray
in interface Column
public it.unimi.dsi.fastutil.doubles.DoubleIterator iterator()
public Selection select(DoublePredicate predicate)
public Selection select(DoubleBiPredicate predicate, double value)
public boolean contains(double value)
public int byteSize()
Column
public byte[] asBytes(int rowNumber)
public DoubleColumn difference()
Column
difference
in interface Column
difference
in class AbstractColumn
Column
public DoubleColumn cumSum()
public DoubleColumn cumProd()
public DoubleColumn pctChange()
Copyright © 2018. All rights reserved.