Package smile.data
Class IndexDataFrame
java.lang.Object
smile.data.IndexDataFrame
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
Constructors -
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 row at the specified index.get(int i, int j) Returns the cell at (i, j).intReturns 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.intncol()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.intsize()Returns the number of rows.stream()Returns a (possibly parallel) Stream of rows.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, waitMethods inherited from interface smile.data.DataFrame
apply, apply, apply, booleanVector, booleanVector, byteVector, byteVector, charVector, charVector, column, column, doubleVector, doubleVector, drop, factorize, fillna, 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, isEmpty, isNullAt, isNullAt, longVector, longVector, measures, names, nrow, of, of, omitNullRows, select, shortVector, shortVector, slice, stringVector, stringVector, structure, summary, toArray, toArray, toList, toMatrix, toMatrix, toString, toString, toString, toString, toStrings, toStrings, types, vector, vectorMethods 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:DataFrameReturns the schema of DataFrame. -
toString
-
indexOf
Description copied from interface:DataFrameReturns the index of a given column name. -
size
public int size()Description copied from interface:DataFrameReturns the number of rows. -
ncol
public int ncol()Description copied from interface:DataFrameReturns the number of columns. -
get
Description copied from interface:DataFrameReturns the cell at (i, j). -
stream
Description copied from interface:DataFrameReturns a (possibly parallel) Stream of rows. -
iterator
-
column
Description copied from interface:DataFrameSelects column based on the column index. -
vector
Description copied from interface:DataFrameSelects column based on the column index. -
booleanVector
Description copied from interface:DataFrameSelects column based on the column index.- Specified by:
booleanVectorin interfaceDataFrame- Parameters:
i- the column index.- Returns:
- the column vector.
-
charVector
Description copied from interface:DataFrameSelects column based on the column index.- Specified by:
charVectorin interfaceDataFrame- Parameters:
i- the column index.- Returns:
- the column vector.
-
byteVector
Description copied from interface:DataFrameSelects column based on the column index.- Specified by:
byteVectorin interfaceDataFrame- Parameters:
i- the column index.- Returns:
- the column vector.
-
shortVector
Description copied from interface:DataFrameSelects column based on the column index.- Specified by:
shortVectorin interfaceDataFrame- Parameters:
i- the column index.- Returns:
- the column vector.
-
intVector
Description copied from interface:DataFrameSelects column based on the column index. -
longVector
Description copied from interface:DataFrameSelects column based on the column index.- Specified by:
longVectorin interfaceDataFrame- Parameters:
i- the column index.- Returns:
- the column vector.
-
floatVector
Description copied from interface:DataFrameSelects column based on the column index.- Specified by:
floatVectorin interfaceDataFrame- Parameters:
i- the column index.- Returns:
- the column vector.
-
doubleVector
Description copied from interface:DataFrameSelects column based on the column index.- Specified by:
doubleVectorin interfaceDataFrame- Parameters:
i- the column index.- Returns:
- the column vector.
-
stringVector
Description copied from interface:DataFrameSelects column based on the column index.- Specified by:
stringVectorin interfaceDataFrame- Parameters:
i- the column index.- Returns:
- the column vector.
-
select
Description copied from interface:DataFrameReturns a new DataFrame with selected columns. -
drop
Description copied from interface:DataFrameReturns a new DataFrame without selected columns. -
merge
Description copied from interface:DataFrameMerges data frames horizontally by columns. -
merge
Description copied from interface:DataFrameMerges vectors with this data frame. -
union
Description copied from interface:DataFrameUnions data frames vertically by rows. -
get
Description copied from interface:DataFrameReturns the row at the specified index.
-