public interface DataFrame extends DataContainer<DataFrameHeader,DataRow>
| Modifier and Type | Method and Description |
|---|---|
DataFrame |
addBooleanColumn(String name)
Adds a new
BooleanColumn to the dataframe. |
DataFrame |
addByteColumn(String name)
Adds a new
ByteColumn to the dataframe. |
<T extends Comparable<T>,C extends DataFrameColumn<T,C>> |
addColumn(Class<C> type,
String name,
ColumnAppender<T> appender)
Creates and adds a column to this data frame based on a provided column class.
|
<T extends Comparable<T>> |
addColumn(Class<T> type,
String name)
Creates a column for a specified column value type.
|
<T extends Comparable<T>> |
addColumn(Class<T> type,
String name,
ColumnTypeMap columnTypeMap)
Creates a column for a specified column value type using the provided
ColumnTypeMap. |
<T extends Comparable<T>,C extends DataFrameColumn<T,C>> |
addColumn(Class<T> type,
String name,
ColumnTypeMap columnTypeMap,
ColumnAppender<T> appender)
Creates and adds a new column based on a specified column value type and a
ColumnTypeMap. |
DataFrame |
addColumn(DataFrameColumn column)
Adds a column to the data frame.
|
DataFrame |
addColumns(Collection<DataFrameColumn> columns)
Adds a collection of columns to this data frame
|
DataFrame |
addColumns(DataFrameColumn... columns)
Adds an array of columns to this data frame
|
DataFrame |
addDoubleColumn(String name)
Adds a new
DoubleColumn to the dataframe. |
DataFrame |
addFloatColumn(String name)
Adds a new
FloatColumn to the dataframe. |
DataFrame |
addIndex(Index index)
Adds a new index to the dataframe
|
DataFrame |
addIndex(String indexName,
DataFrameColumn... columns)
Adds a new index based on one or multiple index columns.
|
DataFrame |
addIndex(String indexName,
String... columnNames)
Adds a new index based on one or multiple index columns.
|
DataFrame |
addIntegerColumn(String name)
Adds a new
IntegerColumn to the dataframe. |
DataFrame |
addLongColumn(String name)
Adds a new
LongColumn to the dataframe. |
DataFrame |
addShortColumn(String name)
Adds a new
ShortColumn to the dataframe. |
DataFrame |
addStringColumn(String name)
Adds a new
StringColumn to the dataframe. |
DataFrame |
append(Comparable... values)
Appends a new row based on
Comparable values. |
DataFrame |
append(DataFrame dataFrame,
int rowIndex)
Appends a new row based on
Comparable values from another dataframe. |
DataFrame |
append(DataRow row)
Appends a new data row.
|
DataFrame |
appendMatchingRow(DataRow row)
Appends a new data row.
|
static DataFrameBuilder |
builder()
Creates a new
DataFrameBuilder |
void |
clear()
Clears all columns
|
DataFrame |
concat(Collection<DataFrame> dataFrames)
Appends the rows from a collection of data frames to this data frame.
|
DataFrame |
concat(DataFrame... dataFrames)
Appends the rows from an array of data frames to this data frame.
|
DataFrame |
concat(DataFrame other)
Concatenates two data frames.
|
boolean |
containsColumn(DataFrameColumn column)
Returns true if this data frame contains the input column
|
DataFrame |
copy()
Returns a copy of this data frame.
|
static DataFrame |
create()
Creates a new
DefaultDataFrame instance |
static DataFrame |
create(String name)
Creates a new
DefaultDataFrame instance with a name |
DataFrame |
filter(FilterPredicate predicate)
Filters data rows that are not valid according to an input predicate.
|
DataFrame |
filter(String predicateString)
Filters data rows that are not valid according to an input predicate.
|
DataFrame |
filterSubset(int from,
int to)
Sets this data frame to a subset of itself.
|
static DataFrame |
fromCSV(byte[] bytes,
char separator,
boolean header)
Loads a data frame from a byte array using the CSV format (
CSVFormat). |
static DataFrame |
fromCSV(byte[] bytes,
char separator,
String headerPrefix)
Loads a data frame from a byte array using the CSV format (
CSVFormat). |
static DataFrame |
fromCSV(File file,
char separator,
boolean header)
Loads a data frame from a file using the CSV format (
CSVFormat). |
static DataFrame |
fromCSV(File file,
char separator,
String headerPrefix)
Loads a data frame from a file string using the CSV format (
CSVFormat). |
static DataFrame |
fromCSV(InputStream is,
char separator,
boolean header)
Loads a data frame from a
InputStream using the CSV format (CSVFormat). |
static DataFrame |
fromCSV(InputStream is,
char separator,
String headerPrefix)
Loads a data frame from a
InputStream using the CSV format (CSVFormat). |
static DataFrame |
fromCSV(Reader reader,
char separator,
boolean header)
|
static DataFrame |
fromCSV(Reader r,
char separator,
String headerPrefix)
|
static DataFrame |
fromCSV(String content,
char separator,
boolean header)
Loads a data frame from a content string using the CSV format (
CSVFormat). |
static DataFrame |
fromCSV(String content,
char separator,
String headerPrefix)
Loads a data frame from a content string using the CSV format (
CSVFormat). |
static DataFrame |
fromCSV(String resource,
ClassLoader classLoader,
char separator,
boolean header)
Loads a data frame from a URL array using the CSV format (
CSVFormat). |
static DataFrame |
fromCSV(String resource,
ClassLoader classLoader,
char separator,
String headerPrefix)
Loads a data frame from a resource using the CSV format (
CSVFormat). |
static DataFrame |
fromCSV(URL url,
char separator,
boolean header)
Loads a data frame from a URL array using the CSV format (
CSVFormat). |
static DataFrame |
fromCSV(URL url,
char separator,
String headerPrefix)
Loads a data frame from a url using the CSV format (
CSVFormat). |
BooleanColumn |
getBooleanColumn(String name)
Returns a
BooleanColumn
If the column is not found or has the wrong type a DataFrameRuntimeException is thrown. |
ByteColumn |
getByteColumn(String name)
Returns a
ByteColumn
If the column is not found or has the wrong type a DataFrameRuntimeException is thrown. |
<T extends Comparable<T>,C extends DataFrameColumn<T,C>> |
getColumn(String name)
Returns a column based on its name
|
<T extends DataFrameColumn> |
getColumn(String name,
Class<T> cl)
Returns a column as a specified column type.
|
Collection<String> |
getColumnNames()
Returns a collection of the column names in this data frame
|
Collection<DataFrameColumn> |
getColumns()
Returns a collection of all columns in this data frame
|
DoubleColumn |
getDoubleColumn(String name)
Returns a
DoubleColumn
If the column is not found or has the wrong type a DataFrameRuntimeException is thrown. |
FloatColumn |
getFloatColumn(String name)
Returns a
FloatColumn
If the column is not found or has the wrong type a DataFrameRuntimeException is thrown. |
DataFrameHeader |
getHeader()
Returns the header of this data frame
|
IntegerColumn |
getIntegerColumn(String name)
Returns a
IntegerColumn
If the column is not found or has the wrong type a DataFrameRuntimeException is thrown. |
LongColumn |
getLongColumn(String name)
Returns a
LongColumn
If the column is not found or has the wrong type a DataFrameRuntimeException is thrown. |
String |
getName()
Returns the name of this dataframe
|
<T extends Number & Comparable<T>,C extends NumberColumn<T,C>> |
getNumberColumn(String name)
Returns a
NumberColumn
If the column is not found or has the wrong type a DataFrameRuntimeException is thrown. |
DataRow |
getRow(int i)
Returns the data row at a specified index
|
DataRows |
getRows()
Returns all rows in this data frame
|
DataRows |
getRows(int from,
int to)
Returns a list the list of rows between from and to.
|
ShortColumn |
getShortColumn(String name)
Returns a
ShortColumn
If the column is not found or has the wrong type a DataFrameRuntimeException is thrown. |
StringColumn |
getStringColumn(String name)
Returns a
StringColumn
If the column is not found or has the wrong type a DataFrameRuntimeException is thrown. |
Comparable |
getValue(int col,
int row)
Returns a value as
Comparable from the specified column and row |
int |
getVersion()
Returns the version of this dataframe.
|
DataGrouping |
groupBy(String... column)
Groups this data frame using one or more columns
|
DataFrame |
head()
Returns the head (top rows) of the dataframe
|
DataFrame |
head(int size)
Returns the head (top rows) of the dataframe
|
boolean |
isCompatible(DataFrame input)
Returns true if the header of an input data frame equals the header of this data frame.
|
boolean |
isEmpty()
Returns true if the dataframe is empty (contains no rows)
|
boolean |
isIndexColumn(DataFrameColumn column)
Returns true if the input column is part of at least one index
|
boolean |
isNA(int col,
int row)
Returns true if the value in the specified column and row is NA
|
JoinedDataFrame |
joinInner(DataFrame dataFrame,
JoinColumn... joinColumns)
Joins this data frame with another data frame using the INNER JOIN method.
|
JoinedDataFrame |
joinInner(DataFrame dataFrame,
String... joinColumns)
Joins this data frame with another data frame using the INNER JOIN method.
|
JoinedDataFrame |
joinInner(DataFrame dataFrame,
String suffixA,
String suffixB,
JoinColumn... joinColumns)
Joins this data frame with another data frame using the INNER JOIN method.
|
JoinedDataFrame |
joinLeft(DataFrame dataFrame,
JoinColumn... joinColumns)
Joins this data frame with another data frame using the LEFT JOIN method.
|
JoinedDataFrame |
joinLeft(DataFrame dataFrame,
String... joinColumns)
Joins this data frame with another data frame using the LEFT JOIN method.
|
JoinedDataFrame |
joinLeft(DataFrame dataFrame,
String suffixA,
String suffixB,
JoinColumn... joinColumns)
Joins this data frame with another data frame using the LEFT JOIN method.
|
JoinedDataFrame |
joinOuter(DataFrame dataFrame,
JoinColumn... joinColumns)
Joins this data frame with another data frame using the OUTER JOIN method.
|
JoinedDataFrame |
joinOuter(DataFrame dataFrame,
String... joinColumns)
Joins this data frame with another data frame using the OUTER JOIN method.
|
JoinedDataFrame |
joinOuter(DataFrame dataFrame,
String suffixA,
String suffixB,
JoinColumn... joinColumns)
Joins this data frame with another data frame using the OUTER JOIN method.
|
JoinedDataFrame |
joinRight(DataFrame dataFrame,
JoinColumn... joinColumns)
Joins this data frame with another data frame using the LEFT JOIN method.
|
JoinedDataFrame |
joinRight(DataFrame dataFrame,
String... joinColumns)
Joins this data frame with another data frame using the RIGHT JOIN method.
|
JoinedDataFrame |
joinRight(DataFrame dataFrame,
String suffixA,
String suffixB,
JoinColumn... joinColumns)
Joins this data frame with another data frame using the RIGHT JOIN method.
|
static DataFrame |
load(byte[] bytes)
Loads a data frame from a byte array using the default tab separated format (
TSVFormat). |
static DataFrame |
load(byte[] bytes,
DataReader reader)
Loads a data frame from a byte array using a specified
DataReader |
static DataFrame |
load(byte[] bytes,
ReadFormat readFormat)
Loads a data frame from a byte array using a specified
ReadFormat. |
static DataFrame |
load(DataIterator<?> dataIterator)
Loads a data frame from a
DataIterator |
static DataFrame |
load(DataIterator<?> dataIterator,
FilterPredicate predicate)
Loads a data frame from a
DataIterator and filters all rows using a specified predicate |
static DataFrame |
load(File file)
Loads a data frame from a file.
|
static DataFrame |
load(File file,
DataReader reader)
Loads a data frame from a file using a specified
DataReader |
static DataFrame |
load(File file,
ReadFormat readFormat)
Loads a data frame from a file using a specified
ReadFormat. |
static DataFrame |
load(InputStream is)
Loads a data frame from a
InputStream using the default tab separated format (TSVFormat). |
static DataFrame |
load(InputStream is,
DataReader reader)
Loads a data frame from a
InputStream using a specified DataReader |
static DataFrame |
load(InputStream is,
ReadFormat readFormat)
Loads a data frame from a
InputStream using a specified ReadFormat. |
static DataFrame |
load(Reader reader)
|
static DataFrame |
load(Reader r,
DataReader reader)
Loads a data frame from a
Reader using a specified DataReader |
static DataFrame |
load(Reader reader,
ReadFormat readFormat)
Loads a data frame from a
Reader using a specified ReadFormat. |
static DataFrame |
load(String content)
Loads a data frame from a content string using the default tab separated format (
TSVFormat). |
static DataFrame |
load(String resource,
ClassLoader classLoader)
Loads a data frame from a resource using the default tab separated format (
TSVFormat). |
static DataFrame |
load(String resource,
ClassLoader classLoader,
DataReader reader)
Loads a data frame from a resource using a specified
DataReader |
static DataFrame |
load(String resource,
ClassLoader classLoader,
ReadFormat readFormat)
Loads a data frame from a resource using a specified
ReadFormat |
static DataFrame |
load(String content,
DataReader reader)
Loads a data frame from a content String using a specified
DataReader |
static DataFrame |
load(String content,
ReadFormat readFormat)
Loads a data frame from a content String using a specified
ReadFormat. |
static DataFrame |
load(URL url)
Loads a data frame from a URL using the default tab separated format (
TSVFormat). |
static DataFrame |
load(URL url,
DataReader reader)
Loads a data frame from a URL using a specified
DataReader |
static DataFrame |
load(URL url,
ReadFormat readFormat)
Loads a data frame from a URL array using a specified
ReadFormat. |
default void |
print()
Prints this dataframe to
System.out using the default print format (DataFrameWriter.DEFAULT_WRITE_FORMAT). |
default void |
print(DataWriter dataWriter)
Prints this dataframe to
System.out using a specified DataWriter. |
default void |
print(WriteFormat writeFormat)
Prints this dataframe to
System.out using a specified WriteFormat. |
DataFrame |
removeColumn(DataFrameColumn column)
Removes a column from this data frame
|
DataFrame |
removeColumn(String header)
Removes a column from this data frame
|
DataFrame |
removeIndex(String name)
Removes the index with the specified name
|
DataFrame |
removePrimaryKey()
Removes the current primary key
|
DataFrame |
renameColumn(String name,
String newName)
Renames a column
|
DataFrame |
replaceColumn(DataFrameColumn existing,
DataFrameColumn replacement) |
DataFrame |
replaceColumn(String existing,
DataFrameColumn replacement) |
DataFrame |
reverse()
Reverses all columns
|
Iterable<? extends DataRow> |
rows()
Returns the indices of this data frame
|
DataFrame |
select(FilterPredicate predicate)
Returns a new data frame based on filtered rows from this data frame.
|
DataFrame |
select(String predicateString)
Returns a new data frame based on filtered rows from this data frame.
|
DataFrame |
select(String colName,
Comparable value)
Returns a new data frame with all rows from this data frame where a specified column value equals
an input value.
|
DataFrame |
selectByIndex(String name,
Comparable... values)
Returns a new dataframe containing data rows found using an index and the corresponding index values
|
DataRow |
selectByPrimaryKey(Comparable... keyValues)
Finds a data row using the primary key
|
ColumnSelection |
selectColumns(DataFrameColumn... columns)
Returns a
ColumnSelection for the selected columns. |
ColumnSelection |
selectColumns(String... columnNames)
Returns a
ColumnSelection for the selected columns. |
DataRow |
selectFirst(FilterPredicate predicate)
Returns the first found data row from this data frame matching an input predicate.
|
DataRow |
selectFirst(String predicateString)
Returns the first found data row from this data frame matching an input predicate.
|
DataRow |
selectFirst(String colName,
Comparable value)
Returns the first found data row from this data frame where a specified column value equals
an input value.
|
DataRow |
selectFirstRowByIndex(String name,
Comparable... values)
Finds the first data row matching an index and the corresponding index values
|
DataRows |
selectRows(Collection<Integer> rowIndices) |
DataRows |
selectRows(FilterPredicate predicate)
Finds data rows using a
FilterPredicate. |
DataRows |
selectRows(String predicateString)
Finds data rows using a
FilterPredicate. |
DataRows |
selectRows(String colName,
Comparable value)
Finds data rows from this data frame where a specified column value equals
an input value.
|
DataRows |
selectRowsByIndex(String name,
Comparable... values)
Finds matching data rows using an index and the corresponding index values
|
DataFrame |
selectSubset(int from,
int to)
Creates a new data frame from a subset of this data frame.
|
DataFrame |
set(DataFrameHeader header) |
DataFrame |
set(DataRows rows)
Clears all rows in this data frame and sets new rows using the provided
DataRows. |
void |
setName(String name)
Sets the name of this dataframe
|
DataFrame |
setPrimaryKey(DataFrameColumn... cols)
Sets the primary key columns using column objects
|
DataFrame |
setPrimaryKey(String... colNames)
Sets the primary key columns using column names
|
void |
setValue(int col,
int row,
Comparable newValue)
Sets the value in the specified column and row
|
DataFrame |
shuffle()
Shuffles all rows
|
int |
size()
Returns the number of rows in this data frame
|
DataFrame |
sort(Comparator<DataRow> comp)
Sorts the rows in this data frame using a custom
Comparator |
DataFrame |
sort(SortColumn... columns)
Sorts the rows in this data frame by one or more
SortColumn |
DataFrame |
sort(String name)
Sorts the rows in this data frame using one column and the default sort direction (ascending)
|
DataFrame |
sort(String name,
SortColumn.Direction dir)
Sorts the rows in this data frame using one column and sort direction.
|
DataFrame |
subset(int from,
int to)
Sets this data frame to a subset of itself.
|
DataFrame |
tail()
Returns the tail (bottom rows) of the dataframe
|
DataFrame |
tail(int size)
Returns the tail (bottom rows) of the dataframe
|
DataFrame |
transform(DataFrameTransform transformer)
Converts this dataframe into another dataframe using a specified transformer
|
DataFrame |
update(DataRow dataRow)
Persists the updated values of a data row.
|
default void |
write(File file)
Writes this dataframe to a file using the default write format (
DataFrameWriter.DEFAULT_WRITE_FORMAT). |
default void |
write(File file,
boolean writeMetaFile)
Writes this dataframe to a file using the default write format (
DataFrameWriter.DEFAULT_WRITE_FORMAT). |
default void |
write(File file,
DataWriter dataWriter)
Writes this dataframe to a file using a specified
DataWriter. |
default void |
write(File file,
DataWriter dataWriter,
boolean writeMetaFile)
Writes this dataframe to a file using a specified
DataWriter. |
default void |
write(File file,
WriteFormat writeFormat)
Writes this dataframe to a file using a specified
WriteFormat. |
default void |
write(File file,
WriteFormat writeFormat,
boolean writeMetaFile)
Writes this dataframe to a file using a specified
WriteFormat. |
default void |
write(OutputStream outputStream)
Writes this dataframe to a
OutputStream using the default write format (DataFrameWriter.DEFAULT_WRITE_FORMAT). |
default void |
write(OutputStream outputStream,
DataWriter dataWriter)
Writes this dataframe to a
OutputStream using a specified DataWriter. |
default void |
write(OutputStream outputStream,
WriteFormat writeFormat)
Writes this dataframe to a
OutputStream using a specified WriteFormat. |
default void |
write(Writer writer)
Writes this dataframe to a
Writer using the default write format (DataFrameWriter.DEFAULT_WRITE_FORMAT). |
default void |
write(Writer writer,
DataWriter dataWriter)
Writes this dataframe to a
Writer using a specified DataWriter. |
default void |
write(Writer writer,
WriteFormat writeFormat)
Writes this dataframe to a
Writer using a specified WriteFormat. |
default void |
writeCSV(File file,
char separator,
boolean writeHeader)
Writes this dataframe to a file using the CSV file format (
CSVFormat) and a specified separator. |
default void |
writeCSV(File file,
char separator,
boolean writeHeader,
boolean writeMetaFile)
Writes this dataframe to a file using the CSV file format (
CSVFormat) and a specified separator. |
default void |
writeCSV(File file,
char separator,
String headerPrefix)
Writes this dataframe to a file using the CSV file format (
CSVFormat) and a specified separator. |
default void |
writeCSV(File file,
char separator,
String headerPrefix,
boolean writeMetaFile)
Writes this dataframe to a file using the CSV file format (
CSVFormat) and a specified separator. |
default void |
writeCSV(OutputStream outputStream,
char separator,
boolean writeHeader)
Writes this dataframe to a
OutputStream using the CSV file format (CSVFormat) and a specified separator. |
default void |
writeCSV(OutputStream outputStream,
char separator,
String headerPrefix)
Writes this dataframe to a
OutputStream using the CSV file format (CSVFormat) and a specified separator. |
default void |
writeCSV(Writer writer,
char separator,
boolean writeHeader)
|
default void |
writeCSV(Writer writer,
char separator,
String headerPrefix)
|
mapforEach, iterator, spliteratorString getName()
void setName(String name)
name - dataframe nameint getVersion()
DataFrame setPrimaryKey(String... colNames)
colNames - primary key columnsDataFrame setPrimaryKey(DataFrameColumn... cols)
cols - primary key columnsDataFrame removePrimaryKey()
DataFrame removeIndex(String name)
name - name of indexDataFrame renameColumn(String name, String newName)
name - current column namenewName - new column nameColumnSelection selectColumns(String... columnNames)
ColumnSelection for the selected columns.
The rows can be filtered using ColumnSelection.where(java.lang.String, java.lang.Comparable).columnNames - selected columnsColumnSelection for row selectionColumnSelection selectColumns(DataFrameColumn... columns)
ColumnSelection for the selected columns.
The rows can be filtered using ColumnSelection.where(java.lang.String, java.lang.Comparable).columns - selected columnsColumnSelection for row selectionDataFrame addColumn(DataFrameColumn column)
DataFrameRuntimeException is thrown.column - column to add<T extends Comparable<T>> DataFrame addColumn(Class<T> type, String name)
T - type of column valuestype - class of column valuesname - column name<T extends Comparable<T>> DataFrame addColumn(Class<T> type, String name, ColumnTypeMap columnTypeMap)
ColumnTypeMap.T - type of column valuestype - class of column valuesname - column namecolumnTypeMap - provided column type mapaddColumn(Class, String, ColumnAppender)<T extends Comparable<T>,C extends DataFrameColumn<T,C>> DataFrame addColumn(Class<T> type, String name, ColumnTypeMap columnTypeMap, ColumnAppender<T> appender)
ColumnTypeMap.T - type of column valuesC - type of created columntype - column value value typename - name of new columncolumnTypeMap - column type map (value type / column class mapper)appender - column appender (value generator)addColumn(Class, String, ColumnAppender)<T extends Comparable<T>,C extends DataFrameColumn<T,C>> DataFrame addColumn(Class<C> type, String name, ColumnAppender<T> appender)
ColumnAppender.T - type of column valuesC - type of created columntype - class of created columnname - name of created columnappender - column appender (value generator)addColumn(DataFrameColumn)DataFrame addBooleanColumn(String name)
BooleanColumn to the dataframe.name - name of the columnDataFrame addByteColumn(String name)
ByteColumn to the dataframe.name - name of the columnDataFrame addDoubleColumn(String name)
DoubleColumn to the dataframe.name - name of the columnDataFrame addFloatColumn(String name)
FloatColumn to the dataframe.name - name of the columnDataFrame addIntegerColumn(String name)
IntegerColumn to the dataframe.name - name of the columnDataFrame addLongColumn(String name)
LongColumn to the dataframe.name - name of the columnDataFrame addShortColumn(String name)
ShortColumn to the dataframe.name - name of the columnDataFrame addStringColumn(String name)
StringColumn to the dataframe.name - name of the columnDataFrame addColumns(Collection<DataFrameColumn> columns)
columns - columns to addDataFrame addColumns(DataFrameColumn... columns)
columns - columns to addDataFrame replaceColumn(DataFrameColumn existing, DataFrameColumn replacement)
DataFrame replaceColumn(String existing, DataFrameColumn replacement)
DataFrame append(DataFrame dataFrame, int rowIndex)
Comparable values from another dataframe.
There must be exactly one value for each column.
The object types have to match the column types.
If the wrong number of values or a wrong type is found aDataFrameRuntimeException is thrown.dataFrame - other dataframerowIndex - row in other dataframeDataFrame append(Comparable... values)
Comparable values.
There must be exactly one value for each column.
The object types have to match the column types.
If the wrong number of values or a wrong type is found aDataFrameRuntimeException is thrown.
If the data frame contains:
StringColumn,DoubleColumn,IntegerColumn
The only correct call to this method is:
append(String, Double, Integer)
empty column values must be provided as null or NA
values - values for the appended rowDataFrame append(DataRow row)
row - row containing the new valuesDataFrame appendMatchingRow(DataRow row)
row - row containing the new valuesDataFrame update(DataRow dataRow)
NA instead-dataRow - data row with updated valuesDataFrame set(DataFrameHeader header)
DataFrame set(DataRows rows)
DataRows.rows - new collection of rowsDataFrame removeColumn(String header)
header - column header nameDataFrame removeColumn(DataFrameColumn column)
column - column to removeDataFrame sort(SortColumn... columns)
SortColumncolumns - sort columnsDataFrame sort(Comparator<DataRow> comp)
Comparatorcomp - comparator used to sort the rowsDataFrame sort(String name)
name - sort columnDataFrame sort(String name, SortColumn.Direction dir)
name - sort columndir - sort directionDataFrame shuffle()
DataFrame select(String colName, Comparable value)
colName - column namevalue - input valueDataRow selectFirst(String colName, Comparable value)
colName - column namevalue - input valueDataRow selectFirst(String predicateString)
predicateString - input predicate stringselect(FilterPredicate)DataRow selectFirst(FilterPredicate predicate)
predicate - input predicateselect(FilterPredicate)DataFrame select(FilterPredicate predicate)
if(predicate.valid(row)) -> add(row)
predicate - filter predicatefilter(FilterPredicate)DataFrame select(String predicateString)
if(predicate.valid(row)) -> add(row)
predicateString - predicate stringselect(FilterPredicate)DataFrame filter(String predicateString)
if(!predicate.valid(row)) -> remove(row)
predicateString - filter predicate stringDataFrame filter(FilterPredicate predicate)
if(!predicate.valid(row)) -> remove(row)
predicate - filter predicateDataRows selectRows(String colName, Comparable value)
colName - column namevalue - input valueDataRows selectRows(String predicateString)
FilterPredicate.predicateString - input predicate stringDataRows selectRows(FilterPredicate predicate)
FilterPredicate.predicate - input predicateDataFrame transform(DataFrameTransform transformer)
transformer - the applied transformerDataRow selectByPrimaryKey(Comparable... keyValues)
keyValues - input key valuesDataFrame reverse()
DataFrame addIndex(String indexName, String... columnNames)
Values in index columns must be unique for all rows
indexName - name of new indexcolumnNames - index columnsDataFrame addIndex(String indexName, DataFrameColumn... columns)
Values in index columns must be unique for all rows
indexName - name of new indexcolumns - index columnsDataFrame addIndex(Index index)
index - index to addint size()
boolean isEmpty()
DataFrame subset(int from, int to)
from - lowest remaining row indexto - highest remaining row indexDataFrame filterSubset(int from, int to)
from - lowest remaining row indexto - highest remaining row indexDataFrame selectSubset(int from, int to)
from - lowest row indexto - highest row indexDataRows getRows(int from, int to)
from - lowest row indexto - highest row indexDataRows getRows()
DataFrameHeader getHeader()
getHeader in interface DataContainer<DataFrameHeader,DataRow>DataFrame concat(DataFrame other)
DataFrameRuntimeException if the data frames are not compatible.other - other data frameDataFrame concat(Collection<DataFrame> dataFrames)
DataFrameRuntimeException if the data frames are not compatible.dataFrames - other data framesDataFrame concat(DataFrame... dataFrames)
DataFrameRuntimeException if the data frames are not compatible.dataFrames - other data framesboolean isCompatible(DataFrame input)
input - input data frameBasicTypeHeader.equals(Object)DataRow getRow(int i)
i - index of data rowCollection<String> getColumnNames()
<T extends Comparable<T>,C extends DataFrameColumn<T,C>> DataFrameColumn<T,C> getColumn(String name)
T - value type of the columnC - column typename - column name<T extends DataFrameColumn> T getColumn(String name, Class<T> cl)
DataFrameRuntimeException is thrown.T - type of columnname - column namecl - class of column<T extends Number & Comparable<T>,C extends NumberColumn<T,C>> NumberColumn<T,C> getNumberColumn(String name)
NumberColumn
If the column is not found or has the wrong type a DataFrameRuntimeException is thrown.T - value type of the columnC - column typename - column nameStringColumn getStringColumn(String name)
StringColumn
If the column is not found or has the wrong type a DataFrameRuntimeException is thrown.name - column nameDoubleColumn getDoubleColumn(String name)
DoubleColumn
If the column is not found or has the wrong type a DataFrameRuntimeException is thrown.name - column nameIntegerColumn getIntegerColumn(String name)
IntegerColumn
If the column is not found or has the wrong type a DataFrameRuntimeException is thrown.name - column nameFloatColumn getFloatColumn(String name)
FloatColumn
If the column is not found or has the wrong type a DataFrameRuntimeException is thrown.name - column nameBooleanColumn getBooleanColumn(String name)
BooleanColumn
If the column is not found or has the wrong type a DataFrameRuntimeException is thrown.name - column nameByteColumn getByteColumn(String name)
ByteColumn
If the column is not found or has the wrong type a DataFrameRuntimeException is thrown.name - column nameLongColumn getLongColumn(String name)
LongColumn
If the column is not found or has the wrong type a DataFrameRuntimeException is thrown.name - column nameShortColumn getShortColumn(String name)
ShortColumn
If the column is not found or has the wrong type a DataFrameRuntimeException is thrown.name - column nameDataGrouping groupBy(String... column)
column - group columnsdata groupingGroupUtil.groupBy(DataFrame, String...)JoinedDataFrame joinLeft(DataFrame dataFrame, String... joinColumns)
dataFrame - other data framejoinColumns - join columnsJoinUtil.leftJoin(DataFrame, DataFrame, JoinColumn...)JoinedDataFrame joinLeft(DataFrame dataFrame, JoinColumn... joinColumns)
dataFrame - other data framejoinColumns - join columnsJoinUtil.leftJoin(DataFrame, DataFrame, JoinColumn...)JoinedDataFrame joinLeft(DataFrame dataFrame, String suffixA, String suffixB, JoinColumn... joinColumns)
dataFrame - other data framesuffixA - suffixes for columns from this data framesuffixB - suffixes for columns from the other data framejoinColumns - join columnsJoinUtil.leftJoin(DataFrame, DataFrame, String, String, JoinColumn...)JoinedDataFrame joinRight(DataFrame dataFrame, String... joinColumns)
dataFrame - other data framejoinColumns - join columnsJoinUtil.rightJoin(DataFrame, DataFrame, JoinColumn...)JoinedDataFrame joinRight(DataFrame dataFrame, JoinColumn... joinColumns)
dataFrame - other data framejoinColumns - join columnsJoinUtil.leftJoin(DataFrame, DataFrame, JoinColumn...)JoinedDataFrame joinRight(DataFrame dataFrame, String suffixA, String suffixB, JoinColumn... joinColumns)
dataFrame - other data framesuffixA - suffixes for columns from this data framesuffixB - suffixes for columns from the other data framejoinColumns - join columnsJoinUtil.rightJoin(DataFrame, DataFrame, String, String, JoinColumn...)JoinedDataFrame joinInner(DataFrame dataFrame, String... joinColumns)
dataFrame - other data framejoinColumns - join columnsJoinUtil.innerJoin(DataFrame, DataFrame, JoinColumn...)JoinedDataFrame joinInner(DataFrame dataFrame, JoinColumn... joinColumns)
dataFrame - other data framejoinColumns - join columnsJoinUtil.innerJoin(DataFrame, DataFrame, JoinColumn...)JoinedDataFrame joinInner(DataFrame dataFrame, String suffixA, String suffixB, JoinColumn... joinColumns)
dataFrame - other data framesuffixA - suffixes for columns from this data framesuffixB - suffixes for columns from the other data framejoinColumns - join columnsJoinUtil.innerJoin(DataFrame, DataFrame, String, String, JoinColumn...)JoinedDataFrame joinOuter(DataFrame dataFrame, String... joinColumns)
dataFrame - other data framejoinColumns - join columnsJoinUtil.innerJoin(DataFrame, DataFrame, JoinColumn...)JoinedDataFrame joinOuter(DataFrame dataFrame, JoinColumn... joinColumns)
dataFrame - other data framejoinColumns - join columnsJoinUtil.innerJoin(DataFrame, DataFrame, JoinColumn...)JoinedDataFrame joinOuter(DataFrame dataFrame, String suffixA, String suffixB, JoinColumn... joinColumns)
dataFrame - other data framesuffixA - suffixes for columns from this data framesuffixB - suffixes for columns from the other data framejoinColumns - join columnsJoinUtil.innerJoin(DataFrame, DataFrame, String, String, JoinColumn...)DataFrame copy()
boolean containsColumn(DataFrameColumn column)
column - input columnboolean isIndexColumn(DataFrameColumn column)
column - input columnDataRows selectRowsByIndex(String name, Comparable... values)
name - name of indexvalues - index valuesDataRows selectRows(Collection<Integer> rowIndices)
DataRow selectFirstRowByIndex(String name, Comparable... values)
name - name of indexvalues - index valuesDataFrame selectByIndex(String name, Comparable... values)
name - name of indexvalues - index valuesCollection<DataFrameColumn> getColumns()
Iterable<? extends DataRow> rows()
static DataFrame create()
DefaultDataFrame instancestatic DataFrame create(String name)
DefaultDataFrame instance with a namename - dataframe namestatic DataFrameBuilder builder()
DataFrameBuilderstatic DataFrame load(File file)
file+'.dfm'file - data frame filestatic DataFrame load(String content)
TSVFormat).content - content stringstatic DataFrame load(String resource, ClassLoader classLoader)
TSVFormat).resource - resource pathclassLoader - class loader used to find the resourcestatic DataFrame load(URL url)
TSVFormat).url - input urlstatic DataFrame load(byte[] bytes)
TSVFormat).bytes - input byte arraystatic DataFrame load(InputStream is)
InputStream using the default tab separated format (TSVFormat).is - input streamstatic DataFrame load(Reader reader)
reader - input readerstatic DataFrame load(File file, ReadFormat readFormat)
ReadFormat.file - input filereadFormat - read formatstatic DataFrame load(String content, ReadFormat readFormat)
ReadFormat.content - content stringreadFormat - read formatstatic DataFrame load(String resource, ClassLoader classLoader, ReadFormat readFormat)
ReadFormatresource - resource pathclassLoader - ClassLoader used to find the resourcereadFormat - read formatstatic DataFrame load(URL url, ReadFormat readFormat)
ReadFormat.url - input urlreadFormat - read formatstatic DataFrame load(byte[] bytes, ReadFormat readFormat)
ReadFormat.bytes - input byte arrayreadFormat - read formatstatic DataFrame load(InputStream is, ReadFormat readFormat)
InputStream using a specified ReadFormat.is - input streamreadFormat - read formatstatic DataFrame load(Reader reader, ReadFormat readFormat)
Reader using a specified ReadFormat.reader - input streamreadFormat - read formatstatic DataFrame load(File file, DataReader reader)
DataReaderfile - input filereader - data readerstatic DataFrame load(String content, DataReader reader)
DataReadercontent - content stringreader - data readerstatic DataFrame load(String resource, ClassLoader classLoader, DataReader reader)
DataReaderresource - resource pathclassLoader - ClassLoader used to find the resourcereader - data readerstatic DataFrame load(URL url, DataReader reader)
DataReaderurl - input urlreader - data readerstatic DataFrame load(byte[] bytes, DataReader reader)
DataReaderbytes - input byte arrayreader - data readerstatic DataFrame load(InputStream is, DataReader reader)
InputStream using a specified DataReaderis - inputreader - data readerstatic DataFrame load(Reader r, DataReader reader)
Reader using a specified DataReaderr - input readerreader - data readerstatic DataFrame load(DataIterator<?> dataIterator)
DataIteratordataIterator - data iteratorstatic DataFrame load(DataIterator<?> dataIterator, FilterPredicate predicate)
DataIterator and filters all rows using a specified predicatedataIterator - data iteratorpredicate - filter predicatestatic DataFrame fromCSV(File file, char separator, boolean header)
CSVFormat).
The column separator can be specified. If the CSV contains no header, the columns are named V1, V2,...file - input fileseparator - column separatorheader - specifies wether the csv contains a header or notstatic DataFrame fromCSV(String content, char separator, boolean header)
CSVFormat).
The column separator can be specified. If the CSV contains no header, the columns are named V1, V2,...content - content stringseparator - column separatorheader - specifies wether the csv contains a header or notstatic DataFrame fromCSV(String resource, ClassLoader classLoader, char separator, boolean header)
CSVFormat).
The column separator can be specified. If the CSV contains no header, the columns are named V1, V2,...resource - resource pathclassLoader - class loader used to find the resourceseparator - column separatorheader - specifies wether the csv contains a header or notstatic DataFrame fromCSV(URL url, char separator, boolean header)
CSVFormat).
The column separator can be specified. If the CSV contains no header, the columns are named V1, V2,...url - input urlseparator - column separatorheader - specifies wether the csv contains a header or notstatic DataFrame fromCSV(byte[] bytes, char separator, boolean header)
CSVFormat).
The column separator can be specified. If the CSV contains no header, the columns are named V1, V2,...bytes - input byte arrayseparator - column separatorheader - specifies wether the csv contains a header or notstatic DataFrame fromCSV(InputStream is, char separator, boolean header)
InputStream using the CSV format (CSVFormat).
The column separator can be specified. If the CSV contains no header, the columns are named V1, V2,...is - input streamseparator - column separatorheader - specifies wether the csv contains a header or notstatic DataFrame fromCSV(Reader reader, char separator, boolean header)
Reader using the CSV format (CSVFormat).
The column separator can be specified. If the CSV contains no header, the columns are named V1, V2,...reader - input readerseparator - column separatorheader - specifies wether the csv contains a header or notstatic DataFrame fromCSV(File file, char separator, String headerPrefix)
CSVFormat).
The column separator can be specified.
If the header starts with a certain prefix it can be specified, otherwise the prefix should be set to "" or nullfile - input fileseparator - column separatorheaderPrefix - header prefixstatic DataFrame fromCSV(String content, char separator, String headerPrefix)
CSVFormat).
The column separator can be specified.
If the header starts with a certain prefix it can be specified, otherwise the prefix should be set to "" or nullcontent - content stringseparator - column separatorheaderPrefix - header prefixstatic DataFrame fromCSV(String resource, ClassLoader classLoader, char separator, String headerPrefix)
CSVFormat).
The column separator can be specified.
If the header starts with a certain prefix it can be specified, otherwise the prefix should be set to "" or nullresource - resource pathclassLoader - class loader used to find the resourceseparator - column separatorheaderPrefix - header prefixstatic DataFrame fromCSV(URL url, char separator, String headerPrefix)
CSVFormat).
The column separator can be specified.
If the header starts with a certain prefix it can be specified, otherwise the prefix should be set to "" or nullurl - input urlseparator - column separatorheaderPrefix - header prefixstatic DataFrame fromCSV(byte[] bytes, char separator, String headerPrefix)
CSVFormat).
The column separator can be specified.
If the header starts with a certain prefix it can be specified, otherwise the prefix should be set to "" or nullbytes - input byte arrayseparator - column separatorheaderPrefix - header prefixstatic DataFrame fromCSV(InputStream is, char separator, String headerPrefix)
InputStream using the CSV format (CSVFormat).
The column separator can be specified.
If the header starts with a certain prefix it can be specified, otherwise the prefix should be set to "" or nullis - input streamseparator - column separatorheaderPrefix - header prefixstatic DataFrame fromCSV(Reader r, char separator, String headerPrefix)
Reader using the CSV format (CSVFormat).
The column separator can be specified.
If the header starts with a certain prefix it can be specified, otherwise the prefix should be set to "" or nullr - input readerseparator - column separatorheaderPrefix - header prefixdefault void write(File file, DataWriter dataWriter)
DataWriter.
If there is a matching DataReader for the DataWriter, a meta file is written automaticallyfile - target filedataWriter - data writer used to write the dataframedefault void write(File file, DataWriter dataWriter, boolean writeMetaFile)
DataWriter.
If there is a matching ReadFormat for the DataWriter, a meta file is written if specified.file - target filewriteMetaFile - defines whether a meta file should be createddataWriter - data writer used to write the dataframedefault void write(Writer writer, DataWriter dataWriter)
Writer using a specified DataWriter.writer - target writerdataWriter - data writer used to write the dataframedefault void write(OutputStream outputStream, DataWriter dataWriter)
OutputStream using a specified DataWriter.outputStream - target OutputStreamdataWriter - data writer used to write the dataframedefault void write(File file, WriteFormat writeFormat)
WriteFormat.
If there is a matching ReadFormat for the WriteFormat, a meta file is written automaticallyfile - target filewriteFormat - defines the output format used to write the dataframedefault void write(File file, WriteFormat writeFormat, boolean writeMetaFile)
WriteFormat.
If there is a matching ReadFormat for the WriteFormat, a meta file is written if specifiedfile - target filewriteFormat - defines the output format used to write the dataframewriteMetaFile - defines whether a meta file should be createddefault void write(Writer writer, WriteFormat writeFormat)
Writer using a specified WriteFormat.writer - target writerwriteFormat - data writer used to write the dataframedefault void write(OutputStream outputStream, WriteFormat writeFormat)
OutputStream using a specified WriteFormat.outputStream - target OutputStreamwriteFormat - data writer used to write the dataframedefault void write(File file)
DataFrameWriter.DEFAULT_WRITE_FORMAT).
A meta file is written automatically.file - target filedefault void write(File file, boolean writeMetaFile)
DataFrameWriter.DEFAULT_WRITE_FORMAT).
A meta file is written if specified.file - target filewriteMetaFile - defines whether a meta file should be createddefault void write(Writer writer)
Writer using the default write format (DataFrameWriter.DEFAULT_WRITE_FORMAT).writer - target writerdefault void write(OutputStream outputStream)
OutputStream using the default write format (DataFrameWriter.DEFAULT_WRITE_FORMAT).outputStream - target outputStreamdefault void writeCSV(File file, char separator, boolean writeHeader)
CSVFormat) and a specified separator.
A header is written if specified.
A meta file is written automatically.file - target fileseparator - separator charwriteHeader - defines whether the header should be written to the filedefault void writeCSV(File file, char separator, boolean writeHeader, boolean writeMetaFile)
CSVFormat) and a specified separator.
Header and meta file are written if specified.file - target fileseparator - separator charwriteHeader - defines whether the header should be written to the filewriteMetaFile - defines whether a meta file should be writtendefault void writeCSV(Writer writer, char separator, boolean writeHeader)
Writer using the CSV file format (CSVFormat) and a specified separator.
Header and meta file are written if specified.writer - target writerseparator - separator charwriteHeader - defines whether the header should be written to the filedefault void writeCSV(OutputStream outputStream, char separator, boolean writeHeader)
OutputStream using the CSV file format (CSVFormat) and a specified separator.
Header and meta file are written if specified.outputStream - target OutputStreamseparator - separator charwriteHeader - defines whether the header should be written to the filedefault void writeCSV(File file, char separator, String headerPrefix)
CSVFormat) and a specified separator.
Header is written and a header prefix is added.
A meta file is written automatically.file - target fileseparator - separator charheaderPrefix - header prefixdefault void writeCSV(File file, char separator, String headerPrefix, boolean writeMetaFile)
CSVFormat) and a specified separator.
Header is written and a header prefix is added.
A meta file is written if specified.file - target fileseparator - separator charheaderPrefix - header prefixwriteMetaFile - defines whether a meta file should be writtendefault void writeCSV(Writer writer, char separator, String headerPrefix)
Writer using the CSV file format (CSVFormat) and a specified separator.
Header is written and a header prefix is added.writer - target writerseparator - separator charheaderPrefix - header prefixdefault void writeCSV(OutputStream outputStream, char separator, String headerPrefix)
OutputStream using the CSV file format (CSVFormat) and a specified separator.
Header is written and a header prefix is added.outputStream - target OutputStreamseparator - separator charheaderPrefix - header prefixdefault void print()
System.out using the default print format (DataFrameWriter.DEFAULT_WRITE_FORMAT).default void print(DataWriter dataWriter)
System.out using a specified DataWriter.dataWriter - data writer used to print the dataframedefault void print(WriteFormat writeFormat)
System.out using a specified WriteFormat.writeFormat - write format used to print the dataframeComparable getValue(int col, int row)
Comparable from the specified column and rowcol - columnrow - rowvoid setValue(int col,
int row,
Comparable newValue)
col - columnrow - rownewValue - new valueboolean isNA(int col,
int row)
col - columnrow - rowDataFrame head(int size)
size - number of rowsDataFrame head()
DataFrame tail(int size)
size - number of rowsDataFrame tail()
void clear()
Copyright © 2020. All rights reserved.