public class IntColumn extends NumberColumn<Integer> implements CategoricalColumn<Integer>
comparator, locale, printFormatter
DEFAULT_ARRAY_SIZE
Modifier | Constructor and Description |
---|---|
protected |
IntColumn(String name,
it.unimi.dsi.fastutil.ints.IntArrayList data) |
Modifier and Type | Method and Description |
---|---|
IntColumn |
append(Column<Integer> column) |
IntColumn |
append(Column<Integer> column,
int row) |
IntColumn |
append(int i) |
IntColumn |
append(Integer val) |
IntColumn |
appendCell(String value) |
IntColumn |
appendCell(String value,
AbstractParser<?> parser) |
IntColumn |
appendMissing()
Appends a missing value appropriate to the column
|
IntColumn |
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 int to long does not lose any information at all;
the numeric value is preserved exactly.
|
Object[] |
asObjectArray() |
ShortColumn |
asShortColumn()
Returns a new ShortColumn containing a value for each value in this column
A narrowing conversion of a signed integer to an integral type T simply discards all but the n lowest order bits,
where n is the number of bits used to represent type T.
|
IntColumn |
bottom(int n)
Returns the smallest ("bottom") n values in the column
TODO(lwhite): Consider whether this should exclude missing
|
void |
clear() |
int |
compare(Integer o1,
Integer o2) |
IntColumn |
copy()
Returns a deep copy of the receiver
|
int |
countUnique()
Returns the count of unique values in this column.
|
static IntColumn |
create(String name) |
static IntColumn |
create(String name,
int initialSize) |
static IntColumn |
create(String name,
int[] arr) |
IntColumn |
createCol(String name) |
IntColumn |
createCol(String name,
int initialSize) |
IntColumn |
emptyCopy()
Returns a copy of the receiver with no data.
|
IntColumn |
emptyCopy(int rowSize)
Returns an empty copy of the receiver, with its internal storage initialized to the given row size.
|
IntColumn |
filter(Predicate<? super Integer> test)
Returns a new Column of the same type with only those rows satisfying the predicate
|
IntColumn |
first(int numRows) |
Integer |
get(int index) |
double |
getDouble(int row) |
int |
getInt(int row)
Returns the value at the given index.
|
String |
getUnformattedString(int row) |
static IntColumn |
indexColumn(String columnName,
int size,
int startsWith)
Returns a new numeric column initialized with the given name and size.
|
IntColumn |
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(int value) |
Iterator<Integer> |
iterator() |
IntColumn |
lag(int n)
Returns a column of the same type and size as the receiver, containing the receivers values offset by n.
|
IntColumn |
last(int numRows) |
IntColumn |
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.
|
IntColumn |
map(Function<? super Integer,? extends Integer> fun)
Maps the function across all rows, appending the results to a new Column of the same type
|
IntColumn |
max(Column<Integer> other)
Returns a column containing the element-wise min between this column and other column
TODO(lwhite) Override in column subtypes for better performance
|
IntColumn |
min(Column<Integer> other)
Returns a column containing the element-wise min between this column and other column
TODO(lwhite) Override in column subtypes for better performance
|
IntColumn |
removeMissing() |
IntColumn |
sampleN(int n)
Returns a column containing a random sample of the values in this column
|
IntColumn |
sampleX(double proportion)
Returns a table consisting of randomly selected values from this column.
|
IntColumn |
set(int row,
Column<Integer> column,
int sourceRow) |
IntColumn |
set(int i,
int val) |
IntColumn |
set(int i,
Integer val) |
IntColumn |
set(Selection condition,
Column<Integer> other)
Updates this column where values matching the selection are replaced with the corresponding value
from the given column
|
IntColumn |
set(Selection rowSelection,
Integer newValue)
Conditionally update this column, replacing current values with newValue for all rows where the current value
matches the selection criteria
|
IntColumn |
setMissing(int r) |
IntColumn |
setName(String name)
Sets the columns name to the given string
|
int |
size() |
void |
sortAscending() |
void |
sortDescending() |
IntColumn |
sorted(Comparator<? super Integer> comp)
Returns a new Column of the same type sorted according to the provided Comparator
|
IntColumn |
subset(int[] rows) |
IntColumn |
top(int n)
Returns the largest ("top") n values in the column
TODO(lwhite): Consider whether this should exclude missing
|
IntColumn |
unique()
Returns a column of the same type as the receiver, containing only the unique values of the receiver.
|
static boolean |
valueIsMissing(int value) |
IntColumn |
where(Selection selection) |
allMatch, anyMatch, byteSize, countMissing, getString, noneMatch, rowComparator, setPrintFormatter, setPrintFormatter
name, toString, type
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
countByCategory
allMatch, anyMatch, asList, byteSize, columnWidth, contains, count, count, countMissing, getString, 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, 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 IntColumn(String name, it.unimi.dsi.fastutil.ints.IntArrayList data)
public IntColumn createCol(String name, int initialSize)
createCol
in class NumberColumn<Integer>
public IntColumn createCol(String name)
createCol
in class NumberColumn<Integer>
public static IntColumn indexColumn(String columnName, int size, int startsWith)
public int size()
size
in interface Column<Integer>
size
in interface NumberFilters
size
in interface NumberMapFunctions
public static boolean valueIsMissing(int value)
public IntColumn unique()
Column
public IntColumn top(int n)
NumberColumn
top
in class NumberColumn<Integer>
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 IntColumn bottom(int n)
NumberColumn
bottom
in class NumberColumn<Integer>
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 IntColumn 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 IntColumn removeMissing()
removeMissing
in interface Column<Integer>
public IntColumn append(int i)
public IntColumn emptyCopy()
Column
public IntColumn emptyCopy(int rowSize)
Column
public IntColumn copy()
Column
public Object[] asObjectArray()
asObjectArray
in interface Column<Integer>
asObjectArray
in class NumberColumn<Integer>
public int compare(Integer o1, Integer o2)
compare
in interface Comparator<Integer>
public IntColumn set(int i, int val)
public IntColumn appendMissing()
Column
appendMissing
in interface Column<Integer>
appendMissing
in class NumberColumn<Integer>
public byte[] asBytes(int rowNumber)
NumberColumn
public int countUnique()
Column
countUnique
in interface Column<Integer>
public int getInt(int row)
int
to the argument, with ties
rounding to positive infinity.
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<Integer>
getDouble
in interface NumberFilters
getDouble
in interface NumberMapFunctions
public boolean isMissingValue(int value)
public boolean isMissing(int rowNumber)
public void sortAscending()
sortAscending
in interface Column<Integer>
public void sortDescending()
sortDescending
in interface Column<Integer>
public IntColumn appendCell(String value)
appendCell
in interface Column<Integer>
public IntColumn appendCell(String value, AbstractParser<?> parser)
appendCell
in interface Column<Integer>
public String getUnformattedString(int row)
getUnformattedString
in interface Column<Integer>
public IntColumn inRange(int start, int end)
Column
public IntColumn lead(int n)
Column
public IntColumn setName(String name)
Column
public IntColumn filter(Predicate<? super Integer> test)
Column
public IntColumn sorted(Comparator<? super Integer> comp)
Column
public IntColumn map(Function<? super Integer,? extends Integer> fun)
Column
public IntColumn min(Column<Integer> other)
Column
public IntColumn max(Column<Integer> other)
Column
public IntColumn set(Selection condition, Column<Integer> other)
Column
public IntColumn set(Selection rowSelection, Integer newValue)
Column
public IntColumn sampleN(int n)
Column
public IntColumn sampleX(double proportion)
Column
public LongColumn asLongColumn()
asLongColumn
in interface NumericColumn<Integer>
public FloatColumn asFloatColumn()
asFloatColumn
in interface NumericColumn<Integer>
public DoubleColumn asDoubleColumn()
asDoubleColumn
in interface NumericColumn<Integer>
public ShortColumn asShortColumn()
asShortColumn
in interface NumericColumn<Integer>
public IntColumn setMissing(int r)
setMissing
in interface Column<Integer>
Copyright © 2018. All rights reserved.