public class FloatColumn extends NumberColumn<Float>
comparator, locale
DEFAULT_ARRAY_SIZE
Modifier and Type | Method and Description |
---|---|
FloatColumn |
append(Column<Float> column) |
FloatColumn |
append(Column<Float> column,
int row) |
FloatColumn |
append(float i) |
FloatColumn |
append(Float val) |
FloatColumn |
appendCell(String value) |
FloatColumn |
appendCell(String value,
AbstractColumnParser<?> parser) |
FloatColumn |
appendMissing()
Appends a missing value appropriate to the column
|
FloatColumn |
appendObj(Object obj) |
byte[] |
asBytes(int rowNumber)
Returns the contents of the cell at rowNumber as a byte[]
|
DoubleColumn |
asDoubleColumn()
Returns a new DoubleColumn containing a value for each value in this column.
|
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
|
Float[] |
asObjectArray() |
ShortColumn |
asShortColumn()
Returns a new IntColumn containing a value for each value in this column, truncating if
necessary.
|
FloatColumn |
bottom(int n)
Returns the smallest ("bottom") n values in the column TODO(lwhite): Consider whether this
should exclude missing
|
void |
clear() |
int |
compare(Float o1,
Float o2) |
FloatColumn |
copy()
Returns a deep copy of the receiver
|
int |
countUnique()
Returns the count of unique values in this column.
|
static FloatColumn |
create(String name) |
static FloatColumn |
create(String name,
float[] arr) |
static FloatColumn |
create(String name,
Float[] arr) |
static FloatColumn |
create(String name,
int initialSize) |
static FloatColumn |
create(String name,
Stream<Float> stream) |
FloatColumn |
createCol(String name) |
FloatColumn |
createCol(String name,
int initialSize) |
FloatColumn |
emptyCopy()
Returns a copy of the receiver with no data.
|
FloatColumn |
emptyCopy(int rowSize)
Returns an empty copy of the receiver, with its internal storage initialized to the given row
size.
|
FloatColumn |
filter(Predicate<? super Float> test)
Returns a new Column of the same type with only those rows satisfying the predicate
|
FloatColumn |
first(int numRows) |
Float |
get(int index) |
double |
getDouble(int row) |
float |
getFloat(int row)
Returns a float representation of the data at the given index.
|
String |
getString(int row)
Returns a string representation of the value at the given row.
|
String |
getUnformattedString(int row) |
FloatColumn |
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(float value) |
Iterator<Float> |
iterator() |
FloatColumn |
lag(int n)
Returns a column of the same type and size as the receiver, containing the receivers values
offset by n.
|
FloatColumn |
last(int numRows) |
FloatColumn |
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.
|
FloatColumn |
map(Function<? super Float,? extends Float> fun)
Maps the function across all rows, appending the results to a new Column of the same type
|
FloatColumn |
max(Column<Float> other)
Returns a column containing the element-wise min between this column and other column
|
FloatColumn |
min(Column<Float> other)
Returns a column containing the element-wise min between this column and other column
|
FloatColumn |
removeMissing() |
FloatColumn |
sampleN(int n)
Returns a column containing a random sample of the values in this column
|
FloatColumn |
sampleX(double proportion)
Returns a table consisting of randomly selected values from this column.
|
FloatColumn |
set(DoublePredicate condition,
Float newValue) |
FloatColumn |
set(DoublePredicate condition,
NumberColumn<Float> other)
Updates this column where values matching the selection are replaced with the corresponding
value from the given column
|
FloatColumn |
set(int row,
Column<Float> column,
int sourceRow) |
FloatColumn |
set(int i,
float val) |
FloatColumn |
set(int i,
Float val) |
FloatColumn |
set(Selection condition,
Column<Float> other)
Updates this column where values matching the selection are replaced with the corresponding
value from the given column
|
FloatColumn |
set(Selection rowSelection,
Float newValue)
Conditionally update this column, replacing current values with newValue for all rows where the
current value matches the selection criteria
|
Column<Float> |
setMissing(int i) |
FloatColumn |
setName(String name)
Sets the columns name to the given string
|
int |
size() |
void |
sortAscending() |
void |
sortDescending() |
FloatColumn |
sorted(Comparator<? super Float> comp)
Returns a new Column of the same type sorted according to the provided Comparator
|
FloatColumn |
subset(int[] rows) |
FloatColumn |
top(int n)
Returns the largest ("top") n values in the column TODO(lwhite): Consider whether this should
exclude missing
|
FloatColumn |
unique()
Returns a column of the same type as the receiver, containing only the unique values of the
receiver.
|
static boolean |
valueIsMissing(float value) |
FloatColumn |
where(Selection selection) |
allMatch, anyMatch, byteSize, countMissing, getPrintFormatter, noneMatch, rowComparator, setPrintFormatter, setPrintFormatter
asStringColumn, name, toString, type
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
asDoubleArray, asFloatColumn, 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
public String getString(int row)
Column
public static FloatColumn create(String name)
public static FloatColumn create(String name, float[] arr)
public static FloatColumn create(String name, int initialSize)
public static FloatColumn create(String name, Float[] arr)
public static FloatColumn create(String name, Stream<Float> stream)
public FloatColumn createCol(String name, int initialSize)
createCol
in class NumberColumn<Float>
public FloatColumn createCol(String name)
createCol
in class NumberColumn<Float>
public Float get(int index)
public static boolean valueIsMissing(float value)
public FloatColumn subset(int[] rows)
public int size()
public void clear()
public FloatColumn unique()
Column
Column
public FloatColumn top(int n)
NumberColumn
top
in class NumberColumn<Float>
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 FloatColumn bottom(int n)
NumberColumn
bottom
in class NumberColumn<Float>
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 FloatColumn 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 FloatColumn removeMissing()
public FloatColumn append(float i)
public FloatColumn append(Float val)
public FloatColumn emptyCopy()
Column
public FloatColumn emptyCopy(int rowSize)
Column
public FloatColumn copy()
Column
public Float[] asObjectArray()
public FloatColumn set(int i, Float val)
public FloatColumn set(int i, float val)
public FloatColumn append(Column<Float> column)
public FloatColumn append(Column<Float> column, int row)
public FloatColumn set(int row, Column<Float> column, int sourceRow)
public byte[] asBytes(int rowNumber)
NumberColumn
public int countUnique()
Column
public double getDouble(int row)
public float getFloat(int row)
ClassCastException
- if the value can't be cast to ta floatpublic boolean isMissingValue(float value)
public boolean isMissing(int rowNumber)
public void sortAscending()
public void sortDescending()
public FloatColumn appendMissing()
Column
appendMissing
in interface Column<Float>
appendMissing
in class NumberColumn<Float>
public FloatColumn appendObj(Object obj)
public FloatColumn appendCell(String value)
public FloatColumn appendCell(String value, AbstractColumnParser<?> parser)
public String getUnformattedString(int row)
public FloatColumn inRange(int start, int end)
Column
public FloatColumn where(Selection selection)
public FloatColumn lead(int n)
Column
public FloatColumn setName(String name)
Column
public FloatColumn filter(Predicate<? super Float> test)
Column
test
- the predicatepublic FloatColumn sorted(Comparator<? super Float> comp)
Column
comp
- the Comparatorpublic FloatColumn map(Function<? super Float,? extends Float> fun)
Column
fun
- function to mappublic FloatColumn min(Column<Float> other)
Column
TODO(lwhite) Override in column subtypes for better performance
public FloatColumn max(Column<Float> other)
Column
TODO(lwhite) Override in column subtypes for better performance
public FloatColumn set(Selection condition, Column<Float> other)
Column
public FloatColumn set(Selection rowSelection, Float newValue)
Column
public FloatColumn set(DoublePredicate condition, Float newValue)
set
in class NumberColumn<Float>
public FloatColumn set(DoublePredicate condition, NumberColumn<Float> other)
NumberColumn
set
in class NumberColumn<Float>
public FloatColumn first(int numRows)
public FloatColumn last(int numRows)
public FloatColumn sampleN(int n)
Column
n
- the number of values to selectpublic FloatColumn sampleX(double proportion)
Column
proportion
- The proportion to go in the samplepublic 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
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
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 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
public DoubleColumn asDoubleColumn()
No information is lost in converting from the floats to doubles
A missing value in the receiver is converted to a missing value in the result
Copyright © 2019. All rights reserved.