Package smile.data
Class IndexDataFrame
java.lang.Object
smile.data.IndexDataFrame
- All Implemented Interfaces:
Iterable<BaseVector>
,DataFrame
,Dataset<Tuple>
A data frame with a new index instead of the default [0, n) row index.
-
Nested Class Summary
Nested classes/interfaces inherited from interface smile.data.DataFrame
DataFrame.Collectors
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbooleanVector
(int i) Selects column based on the column index.byteVector
(int i) Selects column based on the column index.charVector
(int i) Selects column based on the column index.column
(int i) Selects column based on the column index.doubleVector
(int i) Selects column based on the column index.drop
(int... cols) Returns a new DataFrame without selected columns.floatVector
(int i) Selects column based on the column index.get
(int i) Returns the element at the specified position in this dataset.get
(int i, int j) Returns the cell at (i, j).int
Returns the index of a given column name.intVector
(int i) Selects column based on the column index.iterator()
longVector
(int i) Selects column based on the column index.Merges data frames horizontally by columns.merge
(BaseVector... vectors) Merges vectors with this data frame.int
ncol()
Returns the number of columns.schema()
Returns the schema of DataFrame.select
(int... cols) Returns a new DataFrame with selected columns.shortVector
(int i) Selects column based on the column index.int
size()
Returns the number of elements in this collection.stream()
Returns a (possibly parallel) Stream with this collection as its source.stringVector
(int i) Selects column based on the column index.toString()
Unions data frames vertically by rows.<T> Vector<T>
vector
(int i) Selects column based on the column index.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface smile.data.DataFrame
apply, apply, booleanVector, booleanVector, byteVector, byteVector, charVector, charVector, column, column, doubleVector, doubleVector, drop, factorize, floatVector, floatVector, get, getArray, getArray, getBoolean, getBoolean, getByte, getByte, getChar, getChar, getDate, getDate, getDateTime, getDateTime, getDecimal, getDecimal, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, getScale, getScale, getShort, getShort, getString, getString, getStruct, getStruct, getTime, getTime, intVector, intVector, isNullAt, isNullAt, longVector, longVector, measures, names, nrow, of, of, omitNullRows, select, shortVector, shortVector, slice, stringVector, stringVector, structure, summary, toArray, toArray, toMatrix, toMatrix, toString, toString, toString, toString, toStrings, toStrings, types, vector, vector
Methods inherited from interface smile.data.Dataset
apply, distributed, isEmpty, toList
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
IndexDataFrame
Constructor.- Parameters:
df
- The underlying data frame.index
- The row index.
-
-
Method Details
-
schema
Description copied from interface:DataFrame
Returns the schema of DataFrame. -
toString
-
iterator
- Specified by:
iterator
in interfaceIterable<BaseVector>
-
indexOf
Description copied from interface:DataFrame
Returns the index of a given column name. -
size
public int size()Description copied from interface:Dataset
Returns the number of elements in this collection. -
ncol
public int ncol()Description copied from interface:DataFrame
Returns the number of columns. -
get
Description copied from interface:DataFrame
Returns the cell at (i, j). -
stream
Description copied from interface:Dataset
Returns a (possibly parallel) Stream with this collection as its source. -
column
Description copied from interface:DataFrame
Selects column based on the column index. -
vector
Description copied from interface:DataFrame
Selects column based on the column index. -
booleanVector
Description copied from interface:DataFrame
Selects column based on the column index.- Specified by:
booleanVector
in interfaceDataFrame
- Parameters:
i
- the column index.- Returns:
- the column vector.
-
charVector
Description copied from interface:DataFrame
Selects column based on the column index.- Specified by:
charVector
in interfaceDataFrame
- Parameters:
i
- the column index.- Returns:
- the column vector.
-
byteVector
Description copied from interface:DataFrame
Selects column based on the column index.- Specified by:
byteVector
in interfaceDataFrame
- Parameters:
i
- the column index.- Returns:
- the column vector.
-
shortVector
Description copied from interface:DataFrame
Selects column based on the column index.- Specified by:
shortVector
in interfaceDataFrame
- Parameters:
i
- the column index.- Returns:
- the column vector.
-
intVector
Description copied from interface:DataFrame
Selects column based on the column index. -
longVector
Description copied from interface:DataFrame
Selects column based on the column index.- Specified by:
longVector
in interfaceDataFrame
- Parameters:
i
- the column index.- Returns:
- the column vector.
-
floatVector
Description copied from interface:DataFrame
Selects column based on the column index.- Specified by:
floatVector
in interfaceDataFrame
- Parameters:
i
- the column index.- Returns:
- the column vector.
-
doubleVector
Description copied from interface:DataFrame
Selects column based on the column index.- Specified by:
doubleVector
in interfaceDataFrame
- Parameters:
i
- the column index.- Returns:
- the column vector.
-
stringVector
Description copied from interface:DataFrame
Selects column based on the column index.- Specified by:
stringVector
in interfaceDataFrame
- Parameters:
i
- the column index.- Returns:
- the column vector.
-
select
Description copied from interface:DataFrame
Returns a new DataFrame with selected columns. -
drop
Description copied from interface:DataFrame
Returns a new DataFrame without selected columns. -
merge
Description copied from interface:DataFrame
Merges data frames horizontally by columns. -
merge
Description copied from interface:DataFrame
Merges vectors with this data frame. -
union
Description copied from interface:DataFrame
Unions data frames vertically by rows. -
get
Description copied from interface:Dataset
Returns the element at the specified position in this dataset.
-