public class ShortColumn extends NumberColumn<Short> implements CategoricalColumn<Short>
comparator, locale, printFormatter
DEFAULT_ARRAY_SIZE
Modifier | Constructor and Description |
---|---|
protected |
ShortColumn(String name,
it.unimi.dsi.fastutil.shorts.ShortArrayList data) |
Modifier and Type | Method and Description |
---|---|
ShortColumn |
append(Column<Short> column) |
ShortColumn |
append(Column<Short> column,
int row) |
ShortColumn |
append(short i) |
ShortColumn |
append(Short val) |
ShortColumn |
appendCell(String value) |
ShortColumn |
appendCell(String value,
AbstractColumnParser<?> parser) |
ShortColumn |
appendMissing()
Appends a missing value appropriate to the column
|
ShortColumn |
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, truncating if necessary.
|
FloatColumn |
asFloatColumn()
Returns a new FloatColumn 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
A widening primitive conversion from short to long does not lose any information at all;
the numeric value is preserved exactly.
|
Short[] |
asObjectArray() |
ShortColumn |
bottom(int n)
Returns the smallest ("bottom") n values in the column
TODO(lwhite): Consider whether this should exclude missing
|
void |
clear() |
int |
compare(Short o1,
Short o2) |
ShortColumn |
copy()
Returns a deep copy of the receiver
|
int |
countUnique()
Returns the count of unique values in this column.
|
static ShortColumn |
create(String name) |
static ShortColumn |
create(String name,
int initialSize) |
static ShortColumn |
create(String name,
short[] arr) |
ShortColumn |
createCol(String name) |
ShortColumn |
createCol(String name,
int initialSize) |
ShortColumn |
emptyCopy()
Returns a copy of the receiver with no data.
|
ShortColumn |
emptyCopy(int rowSize)
Returns an empty copy of the receiver, with its internal storage initialized to the given row size.
|
ShortColumn |
filter(Predicate<? super Short> test)
Returns a new Column of the same type with only those rows satisfying the predicate
|
ShortColumn |
first(int numRows) |
Short |
get(int index) |
double |
getDouble(int row) |
int |
getInt(int row)
Returns the value at the given index.
|
short |
getShort(int index) |
String |
getString(int row)
Returns a string representation of the value at the given row.
|
String |
getUnformattedString(int row) |
ShortColumn |
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(short value) |
Iterator<Short> |
iterator() |
ShortColumn |
lag(int n)
Returns a column of the same type and size as the receiver, containing the receivers values offset by n.
|
ShortColumn |
last(int numRows) |
ShortColumn |
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.
|
ShortColumn |
map(Function<? super Short,? extends Short> fun)
Maps the function across all rows, appending the results to a new Column of the same type
|
ShortColumn |
max(Column<Short> other)
Returns a column containing the element-wise min between this column and other column
TODO(lwhite) Override in column subtypes for better performance
|
ShortColumn |
min(Column<Short> other)
Returns a column containing the element-wise min between this column and other column
TODO(lwhite) Override in column subtypes for better performance
|
ShortColumn |
removeMissing() |
ShortColumn |
sampleN(int n)
Returns a column containing a random sample of the values in this column
|
ShortColumn |
sampleX(double proportion)
Returns a table consisting of randomly selected values from this column.
|
ShortColumn |
set(int row,
Column<Short> column,
int sourceRow) |
ShortColumn |
set(int i,
short val) |
ShortColumn |
set(int i,
Short val) |
ShortColumn |
set(Selection condition,
Column<Short> other)
Updates this column where values matching the selection are replaced with the corresponding value
from the given column
|
ShortColumn |
set(Selection rowSelection,
Short newValue)
Conditionally update this column, replacing current values with newValue for all rows where the current value
matches the selection criteria
|
Column<Short> |
setMissing(int i) |
ShortColumn |
setName(String name)
Sets the columns name to the given string
|
int |
size() |
void |
sortAscending() |
void |
sortDescending() |
ShortColumn |
sorted(Comparator<? super Short> comp)
Returns a new Column of the same type sorted according to the provided Comparator
|
ShortColumn |
subset(int[] rows) |
ShortColumn |
top(int n)
Returns the largest ("top") n values in the column
TODO(lwhite): Consider whether this should exclude missing
|
ShortColumn |
unique()
Returns a column of the same type as the receiver, containing only the unique values of the receiver.
|
static boolean |
valueIsMissing(int value) |
ShortColumn |
where(Selection selection) |
allMatch, anyMatch, byteSize, countMissing, noneMatch, rowComparator, setPrintFormatter, setPrintFormatter
asStringColumn, name, toString, type
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
countByCategory
allMatch, anyMatch, asList, asStringColumn, byteSize, columnWidth, contains, count, count, countMissing, isEmpty, isMissing, isNotMissing, mapInto, max, min, name, noneMatch, print, reduce, reduce, rolling, rowComparator, summary, title, type
forEach, spliterator
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
asDoubleArray, asIntColumn, asShortColumn, asStringColumn, count, count, eval, eval, eval, eval, eval, geometricMean, isEmpty, isIn, isIn, isMissing, isNotIn, isNotIn, isNotMissing, kendalls, kurtosis, mapInto, max, max, mean, median, min, min, pearsons, percentile, populationVariance, product, quadraticMean, quartile1, quartile3, range, reduce, reduce, rolling, skewness, spearmans, standardDeviation, stats, sum, summarize, summary, sumOfLogs, sumOfSquares, variance
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, 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 ShortColumn(String name, it.unimi.dsi.fastutil.shorts.ShortArrayList data)
public static ShortColumn create(String name)
public static ShortColumn create(String name, short[] arr)
public static ShortColumn create(String name, int initialSize)
public ShortColumn createCol(String name, int initialSize)
createCol
in class NumberColumn<Short>
public ShortColumn createCol(String name)
createCol
in class NumberColumn<Short>
public static boolean valueIsMissing(int value)
public short getShort(int index)
public ShortColumn subset(int[] rows)
public int size()
size
in interface Column<Short>
size
in interface NumberFilters
size
in interface NumberMapFunctions
public ShortColumn unique()
Column
public ShortColumn top(int n)
NumberColumn
top
in class NumberColumn<Short>
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 ShortColumn bottom(int n)
NumberColumn
bottom
in class NumberColumn<Short>
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 ShortColumn 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 ShortColumn removeMissing()
removeMissing
in interface Column<Short>
public ShortColumn append(short i)
public ShortColumn append(Short val)
public ShortColumn emptyCopy()
Column
public ShortColumn emptyCopy(int rowSize)
Column
public ShortColumn copy()
Column
public Short[] asObjectArray()
asObjectArray
in interface Column<Short>
public int compare(Short o1, Short o2)
compare
in interface Comparator<Short>
public ShortColumn set(int i, Short val)
public ShortColumn set(int i, short val)
public ShortColumn append(Column<Short> column)
public String getString(int row)
Column
public ShortColumn append(Column<Short> column, int row)
public ShortColumn set(int row, Column<Short> column, int sourceRow)
public ShortColumn appendMissing()
Column
appendMissing
in interface Column<Short>
appendMissing
in class NumberColumn<Short>
public byte[] asBytes(int rowNumber)
NumberColumn
public int countUnique()
Column
countUnique
in interface Column<Short>
public int getInt(int row)
int
to the argument, with ties
rounding to positive infinity.
Special cases:
Special cases:
Integer.MAX_VALUE
, an error will be thrown
row
- the index of the value to be rounded to an integer.int
value.ClassCastException
- if the absolute value of the value to be rounded is too large to be cast to an intpublic double getDouble(int row)
getDouble
in interface NumericColumn<Short>
getDouble
in interface NumberFilters
getDouble
in interface NumberMapFunctions
public boolean isMissingValue(short value)
public boolean isMissing(int rowNumber)
public Column<Short> setMissing(int i)
setMissing
in interface Column<Short>
public void sortAscending()
sortAscending
in interface Column<Short>
public void sortDescending()
sortDescending
in interface Column<Short>
public ShortColumn appendObj(Object obj)
public ShortColumn appendCell(String value)
appendCell
in interface Column<Short>
public ShortColumn appendCell(String value, AbstractColumnParser<?> parser)
appendCell
in interface Column<Short>
public String getUnformattedString(int row)
getUnformattedString
in interface Column<Short>
public ShortColumn inRange(int start, int end)
Column
public ShortColumn where(Selection selection)
public ShortColumn lead(int n)
Column
public ShortColumn setName(String name)
Column
public ShortColumn filter(Predicate<? super Short> test)
Column
public ShortColumn sorted(Comparator<? super Short> comp)
Column
public ShortColumn map(Function<? super Short,? extends Short> fun)
Column
public ShortColumn min(Column<Short> other)
Column
public ShortColumn max(Column<Short> other)
Column
public ShortColumn set(Selection condition, Column<Short> other)
Column
public ShortColumn set(Selection rowSelection, Short newValue)
Column
public ShortColumn first(int numRows)
public ShortColumn last(int numRows)
public ShortColumn sampleN(int n)
Column
public ShortColumn sampleX(double proportion)
Column
public LongColumn asLongColumn()
asLongColumn
in interface NumericColumn<Short>
public FloatColumn asFloatColumn()
asFloatColumn
in interface NumericColumn<Short>
public DoubleColumn asDoubleColumn()
asDoubleColumn
in interface NumericColumn<Short>
Copyright © 2019. All rights reserved.