Iterable<Integer>
, Comparator<Integer>
, CategoricalColumn<Integer>
, NumericColumn<Integer>
, Column<Integer>
, NumberFilters
, NumberMapFunctions
, FilterSpec<Integer>
, NumberFilterSpec<Integer>
public class IntColumn extends NumberColumn<IntColumn,Integer> implements CategoricalColumn<Integer>
Modifier and Type | Field | Description |
---|---|---|
protected it.unimi.dsi.fastutil.ints.IntArrayList |
data |
DEFAULT_ARRAY_SIZE
comparator, locale
Modifier | Constructor | Description |
---|---|---|
protected |
IntColumn(String name,
it.unimi.dsi.fastutil.ints.IntArrayList data) |
Modifier and Type | Method | Description |
---|---|---|
IntColumn |
append(int i) |
|
IntColumn |
append(Integer val) |
Appends value to the bottom of this column and return this column
|
IntColumn |
append(Column<Integer> column) |
Appends all the values in the argument to the bottom of this column and return this column
|
IntColumn |
append(Column<Integer> column,
int row) |
Appends the value at the given row in the given column to the bottom of this column and return
this column
|
IntColumn |
appendCell(String value) |
Add one element to the bottom of this column and set its value to the parsed value of the given
String.
|
IntColumn |
appendCell(String value,
AbstractColumnParser<?> parser) |
Add one element to the bottom of this column and set its value to the parsed value of the given
String, as performed by the given parser
|
IntColumn |
appendMissing() |
Appends a missing value appropriate to the column
|
IntColumn |
appendObj(Object obj) |
Appends the given value to the bottom of this column and return this column
|
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.
|
int[] |
asIntArray() |
|
LongColumn |
asLongColumn() |
Returns a new LongColumn containing a value for each value in this column
|
Integer[] |
asObjectArray() |
Returns an array of objects as appropriate for my type of column
|
ShortColumn |
asShortColumn() |
Returns a new ShortColumn containing a value for each value in this column
|
IntColumn |
bottom(int n) |
Returns the smallest ("bottom") n values in the column TODO(lwhite): Consider whether this
should exclude missing
|
void |
clear() |
Removes all elements TODO: Make this return this column
|
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) |
|
static IntColumn |
create(String name,
Integer[] arr) |
|
static IntColumn |
create(String name,
IntStream stream) |
|
IntColumn |
createCol(String name) |
|
IntColumn |
createCol(String name,
int initialSize) |
|
Integer |
get(int index) |
Returns the value at the given zero-based index
|
double |
getDouble(int row) |
|
int |
getInt(int row) |
Returns the value at the given index.
|
String |
getString(int row) |
Returns a string representation of the value at the given row.
|
String |
getUnformattedString(int row) |
Returns a String representation of the value at index r, without any formatting applied
|
static IntColumn |
indexColumn(String columnName,
int size,
int startsWith) |
Returns a new numeric column initialized with the given name and size.
|
it.unimi.dsi.fastutil.ints.IntIterator |
intIterator() |
|
Selection |
isIn(int... numbers) |
|
boolean |
isMissing(int rowNumber) |
Returns true if the value at rowNumber is missing
|
boolean |
isMissingValue(int value) |
|
Selection |
isNotIn(int... numbers) |
|
Selection |
isNotIn(IntColumn ints) |
|
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 |
removeMissing() |
Returns a copy of this column with the missing values removed
|
IntColumn |
set(int i,
int val) |
|
IntColumn |
set(int i,
Integer val) |
Sets the value at index row to the given value and return this column
|
Column<Integer> |
set(int row,
String stringValue,
AbstractColumnParser<?> parser) |
Sets the value at row to the parsed value of the given String using the given parser and
returns this column
|
IntColumn |
set(int row,
Column<Integer> column,
int sourceRow) |
Sets the value at row to the value at sourceRow in the given column and return this column
|
IntColumn |
setMissing(int r) |
Sets the value at index i to the missing-value indicator for this column type, and return this
column
|
int |
size() |
Returns the number of elements in this column, including missing values
|
void |
sortAscending() |
Sorts my values in ascending order
|
void |
sortDescending() |
Sorts my values in descending order
|
IntColumn |
subset(int[] rows) |
Return a column of the same type containing just those elements whose indexes are included in
the given array
|
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 containing only the unique values
|
static boolean |
valueIsMissing(int value) |
asStringColumn, filter, first, indexOf, inRange, last, map, max, min, name, parser, sampleN, sampleX, set, set, setName, setParser, sorted, toString, type
countByCategory
allMatch, anyMatch, asList, asStringColumn, byteSize, columnWidth, contains, count, count, countMissing, emptyCopy, emptyCopy, filter, first, indexOf, inRange, interpolate, isEmpty, isMissing, isNotMissing, last, lead, map, map, mapInto, max, max, min, min, name, noneMatch, parser, print, reduce, reduce, rolling, rowComparator, sampleN, sampleX, set, set, set, setMissingTo, setName, setParser, sorted, summary, title, type, where
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
forEach, spliterator
byteSize, countMissing, emptyCopy, emptyCopy, getPrintFormatter, rowComparator, set, set, setPrintFormatter, setPrintFormatter
isBetweenExclusive, isBetweenInclusive, isCloseTo, isEqualTo, isEqualTo, isGreaterThan, isGreaterThan, isGreaterThanOrEqualTo, isGreaterThanOrEqualTo, isLessThan, isLessThan, isLessThanOrEqualTo, isLessThanOrEqualTo, isNegative, isNonNegative, isNotEqualTo, isNotEqualTo, isPositive, isZero
abs, add, add, add, asPercent, asRatio, bin, cube, cubeRoot, cumMax, cumMin, 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
allMatch, anyMatch, asDoubleArray, asIntColumn, asStringColumn, autoCorrelation, autoCorrelation, count, count, eval, eval, geometricMean, interpolate, isEmpty, isIn, isMissing, isNotIn, isNotMissing, kendalls, kurtosis, lead, mapInto, max, max, mean, median, min, min, noneMatch, pctChange, pearsons, percentile, populationVariance, product, quadraticMean, quartile1, quartile3, range, reduce, reduce, rolling, skewness, spearmans, standardDeviation, stats, sum, summarize, summary, sumOfLogs, sumOfSquares, variance, where
protected IntColumn(String name, it.unimi.dsi.fastutil.ints.IntArrayList data)
public IntColumn createCol(String name, int initialSize)
createCol
in class NumberColumn<IntColumn,Integer>
public IntColumn createCol(String name)
createCol
in class NumberColumn<IntColumn,Integer>
public static IntColumn indexColumn(String columnName, int size, int startsWith)
public int size()
Column
size
in interface Column<Integer>
size
in interface NumberFilters
size
in interface NumberMapFunctions
public void clear()
Column
public static boolean valueIsMissing(int value)
public Integer get(int index)
Column
public int[] asIntArray()
public IntColumn subset(int[] rows)
AbstractColumn
public IntColumn unique()
Column
public IntColumn top(int n)
NumberColumn
top
in class NumberColumn<IntColumn,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<IntColumn,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()
Column
removeMissing
in interface Column<Integer>
public IntColumn append(int i)
public IntColumn append(Integer val)
Column
public IntColumn copy()
Column
public it.unimi.dsi.fastutil.ints.IntIterator intIterator()
public Integer[] asObjectArray()
Column
asObjectArray
in interface Column<Integer>
public int compare(Integer o1, Integer o2)
compare
in interface Comparator<Integer>
public IntColumn set(int i, Integer val)
Column
public IntColumn set(int i, int val)
public IntColumn append(Column<Integer> column)
Column
public IntColumn append(Column<Integer> column, int row)
Column
public IntColumn set(int row, Column<Integer> column, int sourceRow)
Column
public Column<Integer> set(int row, String stringValue, AbstractColumnParser<?> parser)
Column
public IntColumn appendMissing()
Column
appendMissing
in interface Column<Integer>
appendMissing
in class NumberColumn<IntColumn,Integer>
public byte[] asBytes(int rowNumber)
NumberColumn
public String getString(int row)
Column
public int countUnique()
Column
countUnique
in interface Column<Integer>
public int getInt(int row)
Returns the closest 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 NumberFilters
getDouble
in interface NumberMapFunctions
getDouble
in interface NumericColumn<Integer>
public boolean isMissingValue(int value)
public boolean isMissing(int rowNumber)
Column
isMissing
in interface Column<Integer>
isMissing
in interface NumberMapFunctions
public void sortAscending()
Column
sortAscending
in interface Column<Integer>
public void sortDescending()
Column
sortDescending
in interface Column<Integer>
public IntColumn appendObj(Object obj)
Column
public IntColumn appendCell(String value)
Column
appendCell
in interface Column<Integer>
public IntColumn appendCell(String value, AbstractColumnParser<?> parser)
Column
appendCell
in interface Column<Integer>
public String getUnformattedString(int row)
Column
getUnformattedString
in interface Column<Integer>
public LongColumn asLongColumn()
A widening primitive conversion from int to long does not lose any information at all; the numeric value is preserved exactly.
A missing value in the receiver is converted to a missing value in the result
asLongColumn
in interface NumericColumn<Integer>
public FloatColumn asFloatColumn()
A widening primitive conversion from an int to a float does not lose information about the overall magnitude of a numeric value. It may, however, result in loss of precision - that is, the result may lose some of the least significant bits of the value. In this case, the resulting floating-point value will be a correctly rounded version of the integer value, using IEEE 754 round-to-nearest mode.
Despite the fact that a loss of precision may occur, a widening primitive conversion never results in a run-time exception.
A missing value in the receiver is converted to a missing value in the result
asFloatColumn
in interface NumericColumn<Integer>
public Selection isIn(int... numbers)
public Selection isNotIn(int... numbers)
public DoubleColumn asDoubleColumn()
A widening primitive conversion from an int to a double does not lose information about the overall magnitude of a numeric value. It may, however, result in loss of precision - that is, the result may lose some of the least significant bits of the value. In this case, the resulting floating-point value will be a correctly rounded version of the integer value, using IEEE 754 round-to-nearest mode.
Despite the fact that a loss of precision may occur, a widening primitive conversion never results in a run-time exception.
A missing value in the receiver is converted to a missing value in the result
asDoubleColumn
in interface NumericColumn<Integer>
public ShortColumn asShortColumn()
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. In addition to a possible loss of information about the magnitude of the numeric value, this may cause the sign of the resulting value to differ from the sign of the input value.
In other words, if the element being converted is larger (or smaller) than Short.MAX_VALUE (or Short.MIN_VALUE) you will not get a conventionally good conversion.
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
asShortColumn
in interface NumericColumn<Integer>
public IntColumn setMissing(int r)
Column
setMissing
in interface Column<Integer>
Copyright © 2021. All rights reserved.