Package smile.data
Interface DataFrame
- All Known Implementing Classes:
IndexDataFrame
An immutable collection of data organized into named columns.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiondefault Tupleapply(int i) Returns the row at the specified index.default BaseVectorSelects column using an enum value.default BaseVectorSelects column based on the column name and return it as a Column.booleanVector(int i) Selects column based on the column index.default BooleanVectorbooleanVector(Enum<?> column) Selects column using an enum value.default BooleanVectorbooleanVector(String column) Selects column based on the column name.byteVector(int i) Selects column based on the column index.default ByteVectorbyteVector(Enum<?> column) Selects column using an enum value.default ByteVectorbyteVector(String column) Selects column based on the column name.charVector(int i) Selects column based on the column index.default CharVectorcharVector(Enum<?> column) Selects column using an enum value.default CharVectorcharVector(String column) Selects column based on the column name.column(int i) Selects column based on the column index.default BaseVectorSelects column using an enum value.default BaseVectorSelects column based on the column name.doubleVector(int i) Selects column based on the column index.default DoubleVectordoubleVector(Enum<?> column) Selects column using an enum value.default DoubleVectordoubleVector(String column) Selects column based on the column name.drop(int... columns) Returns a new DataFrame without selected columns.default DataFrameReturns a new DataFrame without selected columns.default DataFrameReturns a new DataFrame with given columns converted to nominal.default DataFramefillna(double value) Fills NaN/Inf values of floating number columns using the specified value.floatVector(int i) Selects column based on the column index.default FloatVectorfloatVector(Enum<?> column) Selects column using an enum value.default FloatVectorfloatVector(String column) Selects column based on the column name.get(int i) Returns the row at the specified index.default Objectget(int i, int j) Returns the cell at (i, j).default ObjectReturns the cell at (i, j).default <T> T[]getArray(int i, int j) Returns the value at position (i, j) of array type.default <T> T[]Returns the field value of array type.default booleangetBoolean(int i, int j) Returns the value at position (i, j) as a primitive boolean.default booleangetBoolean(int i, String column) Returns the field value as a primitive boolean.default bytegetByte(int i, int j) Returns the value at position (i, j) as a primitive byte.default byteReturns the field value as a primitive byte.default chargetChar(int i, int j) Returns the value at position (i, j) as a primitive byte.default charReturns the field value as a primitive byte.default LocalDategetDate(int i, int j) Returns the value at position (i, j) of date type as java.time.LocalDate.default LocalDateReturns the field value of date type as java.time.LocalDate.default LocalDateTimegetDateTime(int i, int j) Returns the value at position (i, j) as java.time.LocalDateTime.default LocalDateTimegetDateTime(int i, String column) Returns the field value as java.time.LocalDateTime.default BigDecimalgetDecimal(int i, int j) Returns the value at position (i, j) of decimal type as java.math.BigDecimal.default BigDecimalgetDecimal(int i, String column) Returns the field value of decimal type as java.math.BigDecimal.default doublegetDouble(int i, int j) Returns the value at position (i, j) as a primitive double.default doubleReturns the field value as a primitive double.default floatgetFloat(int i, int j) Returns the value at position (i, j) as a primitive float.default floatReturns the field value as a primitive float.default intgetInt(int i, int j) Returns the value at position (i, j) as a primitive int.default intReturns the field value as a primitive int.default longgetLong(int i, int j) Returns the value at position (i, j) as a primitive long.default longReturns the field value as a primitive long.default StringgetScale(int i, int j) Returns the value at position (i, j) of NominalScale or OrdinalScale.default StringReturns the field value of NominalScale or OrdinalScale.default shortgetShort(int i, int j) Returns the value at position (i, j) as a primitive short.default shortReturns the field value as a primitive short.default StringgetString(int i, int j) Returns the value at position (i, j) as a String object.default StringReturns the field value as a String object.default TuplegetStruct(int i, int j) Returns the value at position (i, j) of struct type.default TupleReturns the field value of struct type.default LocalTimegetTime(int i, int j) Returns the value at position (i, j) of date type as java.time.LocalTime.default LocalTimeReturns the field value of date type as java.time.LocalTime.intReturns the index of a given column name.intVector(int i) Selects column based on the column index.default IntVectorSelects column using an enum value.default IntVectorSelects column based on the column name.default booleanisEmpty()Returns true if the data frame is empty.default booleanisNullAt(int i, int j) Checks whether the value at position (i, j) is null.default booleanChecks whether the field value is null.longVector(int i) Selects column based on the column index.default LongVectorlongVector(Enum<?> column) Selects column using an enum value.default LongVectorlongVector(String column) Selects column based on the column name.default Measure[]measures()Returns the column's level of measurements.Merges data frames horizontally by columns.merge(BaseVector... vectors) Merges vectors with this data frame.default String[]names()Returns the column names.intncol()Returns the number of columns.default intnrow()Returns the number of rows.default DataFrameof(boolean... index) Returns a new data frame with boolean indexing.static DataFrameCreates a DataFrame from a 2-dimensional array.static DataFrameCreates a DataFrame from a 2-dimensional array.default DataFrameof(int... index) Returns a new data frame with row indexing.static DataFrameCreates a DataFrame from a 2-dimensional array.static DataFrameCreates a DataFrame from a JDBC ResultSet.static <T> DataFrameof(Collection<Map<String, T>> data, StructType schema) Creates a DataFrame from a set of Maps.static DataFrameCreates a DataFrame from a set of tuples.static DataFrameof(List<? extends Tuple> data, StructType schema) Creates a DataFrame from a set of tuples.static <T> DataFrameCreates a DataFrame from a collection.static DataFrameCreates a DataFrame from a stream of tuples.static DataFrameof(Stream<? extends Tuple> data, StructType schema) Creates a DataFrame from a stream of tuples.static DataFrameof(BaseVector... vectors) Creates a DataFrame from a set of vectors.default DataFrameReturns a new data frame without rows that have null/missing values.schema()Returns the schema of DataFrame.select(int... columns) Returns a new DataFrame with selected columns.default DataFrameReturns a new DataFrame with selected columns.shortVector(int i) Selects column based on the column index.default ShortVectorshortVector(Enum<?> column) Selects column using an enum value.default ShortVectorshortVector(String column) Selects column based on the column name.intsize()Returns the number of rows.default DataFrameslice(int from, int to) Copies the specified range into a new data frame.stream()Returns a (possibly parallel) Stream of rows.stringVector(int i) Selects column based on the column index.default StringVectorstringVector(Enum<?> column) Selects column using an enum value.default StringVectorstringVector(String column) Selects column based on the column name.default DataFrameReturns the structure of data frame.default DataFramesummary()Returns the statistic summary of numeric columns.default double[][]toArray(boolean bias, CategoricalEncoder encoder, String... columns) Return an array obtained by converting the columns in a data frame to numeric mode and then binding them together as the columns of a matrix.default double[][]Return an array obtained by converting the columns in a data frame to numeric mode and then binding them together as the columns of a matrix.toList()Returns theListof rows.default MatrixtoMatrix()Return a matrix obtained by converting all the variables in a data frame to numeric mode and then binding them together as the columns of a matrix.default MatrixtoMatrix(boolean bias, CategoricalEncoder encoder, String rowNames) Return a matrix obtained by converting all the variables in a data frame to numeric mode and then binding them together as the columns of a matrix.default StringtoString(int numRows) Returns the string representation of top rows.default StringtoString(int numRows, boolean truncate) Returns the string representation of top rows.default StringtoString(int i, int j) Returns the string representation of the value at position (i, j).default StringReturns the string representation of the field value.default String[][]toStrings(int numRows) Returns the string representation of top rows.default String[][]toStrings(int numRows, boolean truncate) Returns the string representation of top rows.default DataType[]types()Returns the column data types.Unions data frames vertically by rows.<T> Vector<T> vector(int i) Selects column based on the column index.default <T> Vector<T> Selects column using an enum value.default <T> Vector<T> Selects column based on the column name.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
schema
StructType schema()Returns the schema of DataFrame.- Returns:
- the schema.
-
names
Returns the column names.- Returns:
- the column names.
-
types
Returns the column data types.- Returns:
- the column data types.
-
measures
Returns the column's level of measurements.- Returns:
- the column's level of measurements.
-
size
int size()Returns the number of rows.- Returns:
- the number of rows.
-
isEmpty
default boolean isEmpty()Returns true if the data frame is empty.- Returns:
- true if the data frame is empty.
-
get
Returns the row at the specified index.- Parameters:
i- the row index.- Returns:
- the i-th row.
-
apply
Returns the row at the specified index. For Scala's convenience.- Parameters:
i- the row index.- Returns:
- the i-th row.
-
stream
Returns a (possibly parallel) Stream of rows.- Returns:
- a (possibly parallel) Stream of rows.
-
toList
Returns theListof rows.- Returns:
- the
Listof rows.
-
nrow
default int nrow()Returns the number of rows.- Returns:
- the number of rows.
-
ncol
int ncol()Returns the number of columns.- Returns:
- the number of columns.
-
structure
Returns the structure of data frame.- Returns:
- the structure of data frame.
-
omitNullRows
Returns a new data frame without rows that have null/missing values.- Returns:
- the data frame without nulls.
-
fillna
Fills NaN/Inf values of floating number columns using the specified value.- Parameters:
value- the value to replace NAs.- Returns:
- this data frame.
-
get
Returns the cell at (i, j).- Parameters:
i- the row index.j- the column index.- Returns:
- the cell value.
-
get
Returns the cell at (i, j).- Parameters:
i- the row index.column- the column name.- Returns:
- the cell value.
-
of
Returns a new data frame with row indexing.- Parameters:
index- the row indices.- Returns:
- the data frame of selected rows.
-
of
Returns a new data frame with boolean indexing.- Parameters:
index- the boolean index.- Returns:
- the data frame of selected rows.
-
slice
Copies the specified range into a new data frame.- Parameters:
from- the initial index of the range to be copied, inclusiveto- the final index of the range to be copied, exclusive.- Returns:
- the data frame of selected range of rows.
-
isNullAt
default boolean isNullAt(int i, int j) Checks whether the value at position (i, j) is null.- Parameters:
i- the row index.j- the column index.- Returns:
- true if the cell value is null.
-
isNullAt
Checks whether the field value is null.- Parameters:
i- the row index.column- the column name.- Returns:
- true if the cell value is null.
-
getBoolean
default boolean getBoolean(int i, int j) Returns the value at position (i, j) as a primitive boolean.- Parameters:
i- the row index.j- the column index.- Returns:
- the cell value.
- Throws:
ClassCastException- when data type does not match.NullPointerException- when value is null.
-
getBoolean
Returns the field value as a primitive boolean.- Parameters:
i- the row index.column- the column name.- Returns:
- the cell value.
- Throws:
ClassCastException- when data type does not match.NullPointerException- when value is null.
-
getChar
default char getChar(int i, int j) Returns the value at position (i, j) as a primitive byte.- Parameters:
i- the row index.j- the column index.- Returns:
- the cell value.
- Throws:
ClassCastException- when data type does not match.NullPointerException- when value is null.
-
getChar
Returns the field value as a primitive byte.- Parameters:
i- the row index.column- the column name.- Returns:
- the cell value.
- Throws:
ClassCastException- when data type does not match.NullPointerException- when value is null.
-
getByte
default byte getByte(int i, int j) Returns the value at position (i, j) as a primitive byte.- Parameters:
i- the row index.j- the column index.- Returns:
- the cell value.
- Throws:
ClassCastException- when data type does not match.NullPointerException- when value is null.
-
getByte
Returns the field value as a primitive byte.- Parameters:
i- the row index.column- the column name.- Returns:
- the cell value.
- Throws:
ClassCastException- when data type does not match.NullPointerException- when value is null.
-
getShort
default short getShort(int i, int j) Returns the value at position (i, j) as a primitive short.- Parameters:
i- the row index.j- the column index.- Returns:
- the cell value.
- Throws:
ClassCastException- when data type does not match.NullPointerException- when value is null.
-
getShort
Returns the field value as a primitive short.- Parameters:
i- the row index.column- the column name.- Returns:
- the cell value.
- Throws:
ClassCastException- when data type does not match.NullPointerException- when value is null.
-
getInt
default int getInt(int i, int j) Returns the value at position (i, j) as a primitive int.- Parameters:
i- the row index.j- the column index.- Returns:
- the cell value.
- Throws:
ClassCastException- when data type does not match.NullPointerException- when value is null.
-
getInt
Returns the field value as a primitive int.- Parameters:
i- the row index.column- the column name.- Returns:
- the cell value.
- Throws:
ClassCastException- when data type does not match.NullPointerException- when value is null.
-
getLong
default long getLong(int i, int j) Returns the value at position (i, j) as a primitive long.- Parameters:
i- the row index.j- the column index.- Returns:
- the cell value.
- Throws:
ClassCastException- when data type does not match.NullPointerException- when value is null.
-
getLong
Returns the field value as a primitive long.- Parameters:
i- the row index.column- the column name.- Returns:
- the cell value.
- Throws:
ClassCastException- when data type does not match.NullPointerException- when value is null.
-
getFloat
default float getFloat(int i, int j) Returns the value at position (i, j) as a primitive float. Throws an exception if the type mismatches or if the value is null.- Parameters:
i- the row index.j- the column index.- Returns:
- the cell value.
- Throws:
ClassCastException- when data type does not match.NullPointerException- when value is null.
-
getFloat
Returns the field value as a primitive float. Throws an exception if the type mismatches or if the value is null.- Parameters:
i- the row index.column- the column name.- Returns:
- the cell value.
- Throws:
ClassCastException- when data type does not match.NullPointerException- when value is null.
-
getDouble
default double getDouble(int i, int j) Returns the value at position (i, j) as a primitive double.- Parameters:
i- the row index.j- the column index.- Returns:
- the cell value.
- Throws:
ClassCastException- when data type does not match.NullPointerException- when value is null.
-
getDouble
Returns the field value as a primitive double.- Parameters:
i- the row index.column- the column name.- Returns:
- the cell value.
- Throws:
ClassCastException- when data type does not match.NullPointerException- when value is null.
-
getString
Returns the value at position (i, j) as a String object.- Parameters:
i- the row index.j- the column index.- Returns:
- the cell value.
- Throws:
ClassCastException- when data type does not match.
-
getString
Returns the field value as a String object.- Parameters:
i- the row index.column- the column name.- Returns:
- the cell value.
- Throws:
ClassCastException- when data type does not match.
-
toString
Returns the string representation of the value at position (i, j).- Parameters:
i- the row index.j- the column index.- Returns:
- the string representation of cell value.
-
toString
Returns the string representation of the field value.- Parameters:
i- the row index.column- the column name.- Returns:
- the string representation of cell value.
-
getDecimal
Returns the value at position (i, j) of decimal type as java.math.BigDecimal.- Parameters:
i- the row index.j- the column index.- Returns:
- the cell value.
- Throws:
ClassCastException- when data type does not match.
-
getDecimal
Returns the field value of decimal type as java.math.BigDecimal.- Parameters:
i- the row index.column- the column name.- Returns:
- the cell value.
- Throws:
ClassCastException- when data type does not match.
-
getDate
Returns the value at position (i, j) of date type as java.time.LocalDate.- Parameters:
i- the row index.j- the column index.- Returns:
- the cell value.
- Throws:
ClassCastException- when data type does not match.
-
getDate
Returns the field value of date type as java.time.LocalDate.- Parameters:
i- the row index.column- the column name.- Returns:
- the cell value.
- Throws:
ClassCastException- when data type does not match.
-
getTime
Returns the value at position (i, j) of date type as java.time.LocalTime.- Parameters:
i- the row index.j- the column index.- Returns:
- the cell value.
- Throws:
ClassCastException- when data type does not match.
-
getTime
Returns the field value of date type as java.time.LocalTime.- Parameters:
i- the row index.column- the column name.- Returns:
- the cell value.
- Throws:
ClassCastException- when data type does not match.
-
getDateTime
Returns the value at position (i, j) as java.time.LocalDateTime.- Parameters:
i- the row index.j- the column index.- Returns:
- the cell value.
- Throws:
ClassCastException- when data type does not match.
-
getDateTime
Returns the field value as java.time.LocalDateTime.- Parameters:
i- the row index.column- the column name.- Returns:
- the cell value.
- Throws:
ClassCastException- when data type does not match.
-
getScale
Returns the value at position (i, j) of NominalScale or OrdinalScale.- Parameters:
i- the row index.j- the column index.- Returns:
- the cell scale.
- Throws:
ClassCastException- when the data is not nominal or ordinal.
-
getScale
Returns the field value of NominalScale or OrdinalScale.- Parameters:
i- the row index.column- the column name.- Returns:
- the cell scale.
- Throws:
ClassCastException- when the data is not nominal or ordinal.
-
getArray
default <T> T[] getArray(int i, int j) Returns the value at position (i, j) of array type.- Type Parameters:
T- the data type of array elements.- Parameters:
i- the row index.j- the column index.- Returns:
- the cell value.
- Throws:
ClassCastException- when data type does not match.
-
getArray
Returns the field value of array type.- Type Parameters:
T- the data type of array elements.- Parameters:
i- the row index.column- the column name.- Returns:
- the cell value.
- Throws:
ClassCastException- when data type does not match.
-
getStruct
Returns the value at position (i, j) of struct type.- Parameters:
i- the row index.j- the column index.- Returns:
- the cell value.
- Throws:
ClassCastException- when data type does not match.
-
getStruct
Returns the field value of struct type.- Parameters:
i- the row index.column- the column name.- Returns:
- the cell value.
- Throws:
ClassCastException- when data type does not match.
-
indexOf
Returns the index of a given column name.- Parameters:
column- the column name.- Returns:
- the index of column.
- Throws:
IllegalArgumentException- when a field `name` does not exist.
-
apply
Selects column based on the column name and return it as a Column.- Parameters:
column- the column name.- Returns:
- the column vector.
-
apply
Selects column using an enum value.- Parameters:
column- the field enum.- Returns:
- the column vector.
-
column
Selects column based on the column index.- Parameters:
i- the column index.- Returns:
- the column vector.
-
column
Selects column based on the column name.- Parameters:
column- the column name.- Returns:
- the column vector.
-
column
Selects column using an enum value.- Parameters:
column- the column name.- Returns:
- the column vector.
-
vector
Selects column based on the column index.- Type Parameters:
T- the data type of column.- Parameters:
i- the column index.- Returns:
- the column vector.
-
vector
Selects column based on the column name.- Type Parameters:
T- the data type of column.- Parameters:
column- the column name.- Returns:
- the column vector.
-
vector
Selects column using an enum value.- Type Parameters:
T- the data type of column.- Parameters:
column- the column name.- Returns:
- the column vector.
-
booleanVector
Selects column based on the column index.- Parameters:
i- the column index.- Returns:
- the column vector.
-
booleanVector
Selects column based on the column name.- Parameters:
column- the column name.- Returns:
- the column vector.
-
booleanVector
Selects column using an enum value.- Parameters:
column- the column name.- Returns:
- the column vector.
-
charVector
Selects column based on the column index.- Parameters:
i- the column index.- Returns:
- the column vector.
-
charVector
Selects column based on the column name.- Parameters:
column- the column name.- Returns:
- the column vector.
-
charVector
Selects column using an enum value.- Parameters:
column- the column name.- Returns:
- the column vector.
-
byteVector
Selects column based on the column index.- Parameters:
i- the column index.- Returns:
- the column vector.
-
byteVector
Selects column based on the column name.- Parameters:
column- the column name.- Returns:
- the column vector.
-
byteVector
Selects column using an enum value.- Parameters:
column- the column name.- Returns:
- the column vector.
-
shortVector
Selects column based on the column index.- Parameters:
i- the column index.- Returns:
- the column vector.
-
shortVector
Selects column based on the column name.- Parameters:
column- the column name.- Returns:
- the column vector.
-
shortVector
Selects column using an enum value.- Parameters:
column- the column name.- Returns:
- the column vector.
-
intVector
Selects column based on the column index.- Parameters:
i- the column index.- Returns:
- the column vector.
-
intVector
Selects column based on the column name.- Parameters:
column- the column name.- Returns:
- the column vector.
-
intVector
Selects column using an enum value.- Parameters:
column- the column name.- Returns:
- the column vector.
-
longVector
Selects column based on the column index.- Parameters:
i- the column index.- Returns:
- the column vector.
-
longVector
Selects column based on the column name.- Parameters:
column- the column name.- Returns:
- the column vector.
-
longVector
Selects column using an enum value.- Parameters:
column- the column name.- Returns:
- the column vector.
-
floatVector
Selects column based on the column index.- Parameters:
i- the column index.- Returns:
- the column vector.
-
floatVector
Selects column based on the column name.- Parameters:
column- the column name.- Returns:
- the column vector.
-
floatVector
Selects column using an enum value.- Parameters:
column- the column name.- Returns:
- the column vector.
-
doubleVector
Selects column based on the column index.- Parameters:
i- the column index.- Returns:
- the column vector.
-
doubleVector
Selects column based on the column name.- Parameters:
column- the column name.- Returns:
- the column vector.
-
doubleVector
Selects column using an enum value.- Parameters:
column- the column name.- Returns:
- the column vector.
-
stringVector
Selects column based on the column index.- Parameters:
i- the column index.- Returns:
- the column vector.
-
stringVector
Selects column based on the column name.- Parameters:
column- the column name.- Returns:
- the column vector.
-
stringVector
Selects column using an enum value.- Parameters:
column- the column name.- Returns:
- the column vector.
-
select
Returns a new DataFrame with selected columns.- Parameters:
columns- the column indices.- Returns:
- a new DataFrame with selected columns.
-
select
Returns a new DataFrame with selected columns.- Parameters:
columns- the column names.- Returns:
- a new DataFrame with selected columns.
-
drop
Returns a new DataFrame without selected columns.- Parameters:
columns- the column indices.- Returns:
- a new DataFrame without selected columns.
-
drop
Returns a new DataFrame without selected columns.- Parameters:
columns- the column names.- Returns:
- a new DataFrame without selected columns.
-
merge
Merges data frames horizontally by columns.- Parameters:
dataframes- the data frames to merge.- Returns:
- a new data frame that combines this DataFrame with one more other DataFrames by columns.
-
merge
Merges vectors with this data frame.- Parameters:
vectors- the vectors to merge.- Returns:
- a new data frame that combines this DataFrame with one more additional vectors.
-
union
Unions data frames vertically by rows.- Parameters:
dataframes- the data frames to union.- Returns:
- a new data frame that combines all the rows.
-
factorize
Returns a new DataFrame with given columns converted to nominal.- Parameters:
columns- column names. If empty, all object columns in the data frame will be converted.- Returns:
- a new DataFrame.
-
toArray
Return an array obtained by converting the columns in a data frame to numeric mode and then binding them together as the columns of a matrix. Missing values/nulls will be encoded as Double.NaN. No bias term and uses level encoding for categorical variables.- Parameters:
columns- the columns to export. If empty, all columns will be used.- Returns:
- the numeric array.
-
toArray
Return an array obtained by converting the columns in a data frame to numeric mode and then binding them together as the columns of a matrix. Missing values/nulls will be encoded as Double.NaN.- Parameters:
bias- if true, add the first column of all 1's.encoder- the categorical variable encoder.columns- the columns to export. If empty, all columns will be used.- Returns:
- the numeric array.
-
toMatrix
Return a matrix obtained by converting all the variables in a data frame to numeric mode and then binding them together as the columns of a matrix. Missing values/nulls will be encoded as Double.NaN.- Returns:
- the numeric matrix.
-
toMatrix
Return a matrix obtained by converting all the variables in a data frame to numeric mode and then binding them together as the columns of a matrix. Missing values/nulls will be encoded as Double.NaN. No bias term and uses level encoding for categorical variables.- Parameters:
bias- if true, add the first column of all 1's.encoder- the categorical variable encoder.rowNames- the column to be used as row names.- Returns:
- the numeric matrix.
-
summary
Returns the statistic summary of numeric columns.- Returns:
- the statistic summary of numeric columns.
-
toString
Returns the string representation of top rows.- Parameters:
numRows- the number of rows to show- Returns:
- the string representation of top rows.
-
toString
Returns the string representation of top rows.- Parameters:
numRows- Number of rows to showtruncate- Whether truncate long strings and align cells right.- Returns:
- the string representation of top rows.
-
toStrings
Returns the string representation of top rows.- Parameters:
numRows- Number of rows to show- Returns:
- the string representation of top rows.
-
toStrings
Returns the string representation of top rows.- Parameters:
numRows- Number of rows to showtruncate- Whether truncate long strings.- Returns:
- the string representation of top rows.
-
of
Creates a DataFrame from a set of vectors.- Parameters:
vectors- The column vectors.- Returns:
- the data frame.
-
of
Creates a DataFrame from a 2-dimensional array.- Parameters:
data- The data array.names- the name of columns.- Returns:
- the data frame.
-
of
Creates a DataFrame from a 2-dimensional array.- Parameters:
data- The data array.names- the name of columns.- Returns:
- the data frame.
-
of
Creates a DataFrame from a 2-dimensional array.- Parameters:
data- The data array.names- the name of columns.- Returns:
- the data frame.
-
of
Creates a DataFrame from a collection.- Type Parameters:
T- The data type of elements.- Parameters:
data- The data collection.clazz- The class type of elements.- Returns:
- the data frame.
-
of
Creates a DataFrame from a stream of tuples.- Parameters:
data- The data stream.- Returns:
- the data frame.
-
of
Creates a DataFrame from a stream of tuples.- Parameters:
data- The data stream.schema- The schema of tuple.- Returns:
- the data frame.
-
of
Creates a DataFrame from a set of tuples.- Parameters:
data- The data collection.- Returns:
- the data frame.
-
of
Creates a DataFrame from a set of tuples.- Parameters:
data- The data collection.schema- The schema of tuple.- Returns:
- the data frame.
-
of
Creates a DataFrame from a set of Maps.- Type Parameters:
T- The data type of elements.- Parameters:
data- The data collection.schema- The schema of data.- Returns:
- the data frame.
-
of
Creates a DataFrame from a JDBC ResultSet.- Parameters:
rs- The JDBC result set.- Returns:
- the data frame.
- Throws:
SQLException- when JDBC operation fails.
-