Package com.cupoftea.table.interfaces
Class IDataFrame
java.lang.Object
com.cupoftea.table.interfaces.IDataFrame
- Direct Known Subclasses:
DataFrame
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ExecutorServiceprotected Headerprotected Indexprotected Stringprotected booleanprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract IDataFrameabstract IDataFrameabstract IDataFrameabstract IDataFrameaddColumn(int index, String columnName, IColumnCreator columnCreator) abstract IDataFrameaddColumn(int index, String columnName, IColumnCreator columnCreator, Class<?> columnType) abstract IDataFrameabstract IDataFrameaddColumn(int index, String columnName, Class<?> columnType, IColumnCreator columnCreator) abstract IDataFrameabstract IDataFrameaddColumn(String columnName, IColumnCreator columnCreator) abstract IDataFrameaddColumn(String columnName, IColumnCreator columnCreator, Class<?> columnType) abstract IDataFrameabstract IDataFrameaddColumn(String columnName, Class<?> columnType, IColumnCreator columnCreator) abstract IDataFrameabstract IDataFrameabstract IDataFramealterColumnType(String columnName, Class<?> newColumnType) asOfJoin(IDataFrame right, String on) asOfJoin(IDataFrame right, String on, AsOfDirection direction) asOfJoin(IDataFrame right, String on, String by) asOfJoin(IDataFrame right, String on, String by, AsOfDirection direction) asOfJoin(IDataFrame right, String leftOn, String rightOn, String leftBy, String rightBy, AsOfDirection direction) asOfJoin(IDataFrame right, String leftOn, String rightOn, List<String> leftBy, List<String> rightBy, AsOfDirection direction, String leftSuffix, String rightSuffix) asOfJoin(IDataFrame right, String on, List<String> by, AsOfDirection direction) Alias forparallel().asParallel(@NotNull ExecutorService executor) Alias forparallel(ExecutorService).Alias forsequential().abstract IDataFramecategorize(String... columnNames) voidclear()voidabstract ColumnRefstatic IDataFrameconcat(int axis, IDataFrame... frames) static IDataFrameconcat(ConcatAxis axis, IDataFrame... frames) concat(IDataFrame other) Concatenates this DataFrame with another DataFrame along rows (vertical concatenation) using outer join semantics.static IDataFrameconcat(IDataFrame... frames) concat(IDataFrame other, boolean ignoreIndex) Concatenates this DataFrame with another DataFrame along rows with optional index resetting.concat(IDataFrame other, int axis) Concatenates this DataFrame with another DataFrame along the specified axis (0 for ROWS, 1 for COLUMNS) using outer join semantics.concat(IDataFrame other, int axis, JoinType how) Concatenates this DataFrame with another DataFrame along the specified axis using the given join type.concat(IDataFrame other, int axis, String how) Concatenates this DataFrame with another DataFrame along the specified axis using the given join type name.concat(IDataFrame other, ConcatAxis axis) Concatenates this DataFrame with another DataFrame along the specified axis using outer join semantics.concat(IDataFrame other, ConcatAxis axis, JoinType how) Concatenates this DataFrame with another DataFrame along the specified axis using the given join type.concat(IDataFrame other, ConcatAxis axis, JoinType how, boolean ignoreIndex) Concatenates this DataFrame with another DataFrame with full control over axis, join type, and index resetting.concat(IDataFrame other, ConcatAxis axis, String how) Concatenates this DataFrame with another DataFrame along the specified axis using the given join type name.concat(IDataFrame other, JoinType how) Concatenates this DataFrame with another DataFrame along rows using the specified join type.concat(IDataFrame other, String how) Concatenates this DataFrame with another DataFrame along rows using the specified join type name ("outer" or "inner").static IDataFrameconcat(List<? extends IDataFrame> frames) static IDataFrameconcat(List<? extends IDataFrame> frames, int axis) static IDataFrameconcat(List<? extends IDataFrame> frames, ConcatAxis axis) static IDataFrameconcat(List<? extends IDataFrame> frames, ConcatAxis axis, JoinType how) static IDataFrameconcat(List<? extends IDataFrame> frames, ConcatAxis axis, JoinType how, boolean ignoreIndex) static IDataFrameconcat(List<? extends IDataFrame> frames, JoinType how) concatHorizontal(IDataFrame other, String leftSuffix, String rightSuffix) Concatenates this DataFrame with another DataFrame horizontally with custom suffixes for colliding columns.concatWith(IDataFrame... others) Concatenates this DataFrame with multiple other DataFrames along rows.concatWith(List<? extends IDataFrame> others) Concatenates this DataFrame with a list of other DataFrames along rows.abstract IDataFramecopy()protected voidcopyParallelConfigTo(IDataFrame target) abstract IDataFramecorr()abstract Doubleabstract Doublecorrelation(String col1, String col2) abstract IDataFrameintabstract Doubleabstract Doubleabstract Doublecovariance(String col1, String col2) abstract Doublecovariance(String col1, String col2, boolean isSample) crossJoin(IDataFrame other) abstract IDataFrameabstract IDataFrameabstract IDataFrameabstract IDataFramedecodeDictionary(String... columnNames) abstract IDataFrameabstract IDataFramedescribe()abstract IDataFrameabstract IDataFrameabstract IDataFramedistinct()abstract IDataFrameabstract IDataFrameabstract IDataFrameabstract IDataFrameabstract IDataFrameabstract IDataFrameabstract IDataFrameabstract IDataFrameabstract IDataFramedropDuplicates(Keep keep) abstract IDataFramedropDuplicates(Keep keep, String... subset) abstract IDataFramedropDuplicates(String... subset) abstract IDataFramedropDuplicates(List<String> subset) abstract IDataFramedropDuplicates(List<String> subset, Keep keep) abstract IDataFramedropna()abstract IDataFrameabstract IDataFrameabstract IDataFrameabstract IDataFrameabstract IDataFrameencodeDictionary(boolean useShortCodes) encodeDictionary(boolean useShortCodes, String... columnNames) encodeDictionary(String... columnNames) expanding(int minPeriods) abstract IDataFrameabstract IDataFrameabstract IDataFrameabstract IDataFramefilterEquals(String columnName, Object value) filterIn(String columnName, Collection<?> values) filterNotEquals(String columnName, Object value) abstract ColumngetColumnHeader(String columnName) getColumnVector(int index) getColumnVector(String columnName) Returns the configuredExecutorService, orForkJoinPool.commonPool()if none was explicitly set.getIndex()Returns row interchange maps.intReturns the minimum row count threshold below which execution stays sequential.abstract RowgetRow(int index) Returns the unmodifiableRowat the specified index.getRows()Returns an unmodifiable list ofRowviews.abstract Schemaabstract IDataFramehead()abstract IDataFramehead(int n) abstract ILociloc()abstract Rowiloc(int index) abstract Objectiloc(int rowIndex, int colIndex) abstract ObjectinnerJoin(IDataFrame other, String... on) innerJoin(IDataFrame other, String leftOn, String rightOn) innerJoin(IDataFrame other, List<String> on) booleanisCategorical(String columnName) booleanisDictionaryEncoded(String columnName) booleanReturnstrueif parallel execution mode is enabled.join(IDataFrame other) join(IDataFrame other, JoinType how, String on) join(IDataFrame other, JoinType how, String leftOn, String rightOn) join(IDataFrame other, JoinType how, List<String> on) abstract IDataFramejoin(IDataFrame other, JoinType how, List<String> leftOn, List<String> rightOn, String leftSuffix, String rightSuffix) join(IDataFrame other, String on) join(IDataFrame other, String leftOn, String rightOn) join(IDataFrame other, String how, String leftOn, String rightOn) join(IDataFrame other, String how, List<String> on) join(IDataFrame other, String how, List<String> leftOn, List<String> rightOn, String leftSuffix, String rightSuffix) join(IDataFrame other, List<String> on) abstract Doubleabstract Doubleabstract Doubleabstract IDataFrameabstract IDataFrameleftJoin(IDataFrame other, String... on) leftJoin(IDataFrame other, String leftOn, String rightOn) leftJoin(IDataFrame other, List<String> on) abstract Locloc()abstract Rowabstract Objectmap(String columnName, @Nullable Class<?> columnType, IColumnCreator columnCreator) map(String columnName, IColumnCreator columnCreator) mapDouble(String columnName, DoubleUnaryOperator mapper) mapInt(String columnName, IntUnaryOperator mapper) mapLong(String columnName, LongUnaryOperator mapper) abstract Doubleabstract IDataFrameabstract Doubleabstract Doubleabstract IDataFramemelt()abstract IDataFrameabstract IDataFrameabstract IDataFrameabstract Doubleabstract IDataFrameabstract IDataFramemoveColumn(int inicialIndex, int finalIndex) abstract IDataFramemoveColumn(String columnName, int finalIndex) abstract IDataFrameouterJoin(IDataFrame other, String... on) outerJoin(IDataFrame other, String leftOn, String rightOn) outerJoin(IDataFrame other, List<String> on) parallel()Enables multithreaded parallel execution mode usingForkJoinPool.commonPool()(or any previously configured executor).parallel(@NotNull ExecutorService executor) Enables multithreaded parallel execution mode using the providedExecutorService.abstract IDataFrameabstract IDataFramepercentRank(String column) abstract IDataFramepercentRank(String column, String outputColumn) abstract IDataFrameabstract IDataFrameabstract IDataFramepivot(String indexCol, String columnsCol, String valuesCol, Aggregation agg) plot()Obtains a declarative plotting builder for visualizing this DataFrame.Obtains a declarative plotting builder backed by a specific plotting engine.abstract Doubleabstract IDataFrameabstract IDataFrameremoveColumn(int index) abstract IDataFrameremoveColumn(String columnName) abstract IDataFrameremoveRow(int index) abstract IDataFrameremoveRows(IFilter filter) abstract IDataFramerenameColumn(int index, String newName) abstract IDataFramerenameColumn(String oldName, String newName) abstract IDataFramerenameColumn(HashMap<String, String> name) render()Jupyter / Polyglot notebook MIME representation bundle.Jupyter / IJava notebook MIME representation method.abstract IDataFramerightJoin(IDataFrame other, String... on) rightJoin(IDataFrame other, String leftOn, String rightOn) rightJoin(IDataFrame other, List<String> on) rolling(int windowSize) rolling_mean(String column, int windowSize) rolling_mean(String column, int windowSize, String outputColumn) rolling_sum(String column, int windowSize) rolling_sum(String column, int windowSize, String outputColumn) abstract IDataFrameabstract IDataFramesample(double fraction) abstract IDataFramesample(double fraction, boolean replace, long seed) abstract IDataFramesample(double fraction, long seed) abstract IDataFramesample(int n) abstract IDataFramesample(int n, boolean replace) abstract IDataFramesample(int n, boolean replace, long seed) abstract IDataFramesample(int n, long seed) abstract IDataFrameabstract IDataFrameSwitches execution mode back to single-threaded sequential evaluation.voidsetHeaders(ArrayList<Column> headers) abstract IDataFramesetParallelThreshold(int threshold) Sets the minimum row count threshold below which execution automatically stays sequential.abstract IDataFrameprotected booleanshouldExecuteParallel(int rowCount) size()abstract Doubleabstract Doubleabstract Doubleabstract IDataFrameslice(int fromRow, int toRow) abstract DoublestandardDeviation(String column) abstract DoublestandardDeviation(String column, boolean isSample) abstract Doubleabstract Doubleabstract IDataFrameabstract IDataFrametail()abstract IDataFrametail(int n) toCategorical(String... columnNames) toHtml()Renders this DataFrame as a clean, responsive HTML table with sticky headers, data type indicators, and client-side pagination.toHtml(int maxRows) Renders this DataFrame as an HTML table displaying up tomaxRowsrows.toHtml(TableHtmlConfiguration configuration) Renders this DataFrame as an HTML table using the specified configuration.abstract IDataFrametransformColumn(String columnName, ColumnRef columnRef) abstract IDataFrametransformColumn(String columnName, ColumnVector vector) abstract IDataFrametransformColumn(String columnName, Function<ColumnVector, ColumnVector> transformer) abstract IDataFrameabstract Doubleabstract Doubleabstract Doubleabstract Doublewindow()abstract IDataFramewithColumn(String columnName, ColumnRef columnRef) abstract IDataFramewithColumn(String columnName, ColumnVector vector) abstract IDataFramewithColumn(String columnName, IColumnCreator columnCreator) abstract IDataFramewithColumn(String columnName, Class<?> columnType, IColumnCreator columnCreator) withParallelThreshold(int threshold) Fluent alias forsetParallelThreshold(int).write()
-
Field Details
-
header
-
rows
-
indexColumn
-
index
-
parallel
protected boolean parallel -
executor
-
parallelThreshold
protected int parallelThreshold
-
-
Constructor Details
-
IDataFrame
public IDataFrame() -
IDataFrame
-
-
Method Details
-
parallel
Enables multithreaded parallel execution mode usingForkJoinPool.commonPool()(or any previously configured executor). -
parallel
Enables multithreaded parallel execution mode using the providedExecutorService. -
asParallel
Alias forparallel(). -
asParallel
Alias forparallel(ExecutorService). -
sequential
Switches execution mode back to single-threaded sequential evaluation. -
asSequential
Alias forsequential(). -
isParallel
public boolean isParallel()Returnstrueif parallel execution mode is enabled. -
getExecutor
Returns the configuredExecutorService, orForkJoinPool.commonPool()if none was explicitly set. -
getParallelThreshold
public int getParallelThreshold()Returns the minimum row count threshold below which execution stays sequential. -
setParallelThreshold
Sets the minimum row count threshold below which execution automatically stays sequential. -
withParallelThreshold
Fluent alias forsetParallelThreshold(int). -
shouldExecuteParallel
protected boolean shouldExecuteParallel(int rowCount) -
copyParallelConfigTo
-
getRows
Returns an unmodifiable list ofRowviews. Evaluated lazily over the underlying columnar storage without allocating intermediate row maps. -
getRow
Returns the unmodifiableRowat the specified index. The row columns are ordered according to the DataFrame header. -
getInternalRows
Returns row interchange maps. -
getColumnVectors
-
getColumnVector
-
getColumnVector
-
getIndexObject
-
clear
public void clear() -
clearRows
public void clearRows() -
copy
-
getHeaders
-
getColumnHeader
-
getSchema
-
setSchema
-
moveColumn
-
moveColumn
-
renameColumn
-
renameColumn
-
renameColumn
-
addColumn
-
addColumn
-
addColumn
-
addColumn
-
addColumn
-
addColumn
public abstract IDataFrame addColumn(int index, String columnName, @Nullable @Nullable ArrayList<Object> data) -
addColumn
-
addColumn
public abstract IDataFrame addColumn(String columnName, Class<?> columnType, IColumnCreator columnCreator) -
addColumn
public abstract IDataFrame addColumn(String columnName, IColumnCreator columnCreator, Class<?> columnType) -
addColumn
-
addColumn
public abstract IDataFrame addColumn(int index, String columnName, Class<?> columnType, IColumnCreator columnCreator) -
addColumn
public abstract IDataFrame addColumn(int index, String columnName, IColumnCreator columnCreator, Class<?> columnType) -
removeColumn
-
removeColumn
-
alterColumnType
-
col
-
withColumn
-
withColumn
-
withColumn
-
withColumn
public abstract IDataFrame withColumn(String columnName, Class<?> columnType, IColumnCreator columnCreator) -
transformColumn
-
transformColumn
-
transformColumn
public abstract IDataFrame transformColumn(String columnName, Function<ColumnVector, ColumnVector> transformer) -
addRow
-
removeRow
-
removeRows
-
filter
-
update
-
orderBy
-
encodeDictionary
-
encodeDictionary
-
encodeDictionary
-
encodeDictionary
-
decodeDictionary
-
decodeDictionary
-
categorize
-
toCategorical
-
isDictionaryEncoded
-
isCategorical
-
filterEquals
-
filterNotEquals
-
filterIn
-
filterIn
-
map
-
map
public IDataFrame map(String columnName, @Nullable @Nullable Class<?> columnType, IColumnCreator columnCreator) -
mapColumn
-
mapColumn
public IDataFrame mapColumn(String columnName, @Nullable @Nullable Class<?> targetType, Function<Object, ?> valueMapper) -
mapInt
-
mapLong
-
mapDouble
-
map
-
agg
-
sumOf
-
meanOf
-
averageOf
-
minOf
-
maxOf
-
countOf
-
select
-
select
-
drop
-
drop
-
head
-
head
-
tail
-
tail
-
slice
-
iloc
-
iloc
-
iloc
-
iloc
-
getIndex
-
setIndex
-
resetIndex
-
loc
-
loc
-
loc
-
fillna
-
fillna
-
fillna
-
dropna
-
dropna
-
dropna
-
dropna
-
dropna
-
dropna
-
sum
-
average
-
maximum
-
minimum
-
count
-
aggregate
-
mean
-
min
-
max
-
median
-
variance
-
variance
-
var
-
var
-
standardDeviation
-
standardDeviation
-
std
-
std
-
quantile
-
skewness
-
skewness
-
skew
-
kurtosis
-
kurtosis
-
kurt
-
covariance
-
covariance
-
cov
-
cov
-
correlation
-
corr
-
corr
-
describe
-
dropDuplicates
-
dropDuplicates
-
dropDuplicates
-
dropDuplicates
-
dropDuplicates
-
dropDuplicates
-
distinct
-
distinct
-
distinct
-
distinct
-
distinct
-
distinct
-
pivot
-
pivot
public abstract IDataFrame pivot(String indexCol, String columnsCol, String valuesCol, Aggregation agg) -
pivot
public abstract IDataFrame pivot(String indexCol, String columnsCol, String valuesCol, Aggregate agg) -
melt
-
melt
-
melt
-
melt
-
sample
-
sample
-
sample
-
sample
-
sample
-
sample
-
sample
-
size
-
join
-
join
-
join
-
join
-
join
-
join
-
join
-
join
-
join
-
join
-
join
-
join
-
join
public IDataFrame join(IDataFrame other, String how, List<String> leftOn, List<String> rightOn, String leftSuffix, String rightSuffix) -
join
public abstract IDataFrame join(IDataFrame other, JoinType how, List<String> leftOn, List<String> rightOn, String leftSuffix, String rightSuffix) -
innerJoin
-
innerJoin
-
innerJoin
-
innerJoin
-
leftJoin
-
leftJoin
-
leftJoin
-
leftJoin
-
rightJoin
-
rightJoin
-
rightJoin
-
rightJoin
-
outerJoin
-
outerJoin
-
outerJoin
-
outerJoin
-
crossJoin
-
asOfJoin
-
asOfJoin
-
asOfJoin
-
asOfJoin
-
asOfJoin
-
asOfJoin
public IDataFrame asOfJoin(IDataFrame right, String leftOn, String rightOn, String leftBy, String rightBy, AsOfDirection direction) -
asOfJoin
public IDataFrame asOfJoin(IDataFrame right, String leftOn, String rightOn, List<String> leftBy, List<String> rightBy, AsOfDirection direction, String leftSuffix, String rightSuffix) -
concat
Concatenates this DataFrame with another DataFrame along rows (vertical concatenation) using outer join semantics.- Parameters:
other- DataFrame to concatenate with- Returns:
- a new concatenated DataFrame
-
concat
Concatenates this DataFrame with another DataFrame along the specified axis using outer join semantics.- Parameters:
other- DataFrame to concatenate withaxis- axis along which to concatenate (ROWS or COLUMNS)- Returns:
- a new concatenated DataFrame
-
concat
Concatenates this DataFrame with another DataFrame along the specified axis (0 for ROWS, 1 for COLUMNS) using outer join semantics.- Parameters:
other- DataFrame to concatenate withaxis- 0 for ROWS, 1 for COLUMNS- Returns:
- a new concatenated DataFrame
-
concat
Concatenates this DataFrame with another DataFrame along rows using the specified join type.- Parameters:
other- DataFrame to concatenate withhow- join type (OUTER or INNER)- Returns:
- a new concatenated DataFrame
-
concat
Concatenates this DataFrame with another DataFrame along rows using the specified join type name ("outer" or "inner").- Parameters:
other- DataFrame to concatenate withhow- join type name ("outer", "inner")- Returns:
- a new concatenated DataFrame
-
concat
Concatenates this DataFrame with another DataFrame along the specified axis using the given join type.- Parameters:
other- DataFrame to concatenate withaxis- axis along which to concatenatehow- join type (OUTER or INNER)- Returns:
- a new concatenated DataFrame
-
concat
Concatenates this DataFrame with another DataFrame along the specified axis using the given join type.- Parameters:
other- DataFrame to concatenate withaxis- 0 for ROWS, 1 for COLUMNShow- join type (OUTER or INNER)- Returns:
- a new concatenated DataFrame
-
concat
Concatenates this DataFrame with another DataFrame along the specified axis using the given join type name.- Parameters:
other- DataFrame to concatenate withaxis- 0 for ROWS, 1 for COLUMNShow- join type name ("outer", "inner")- Returns:
- a new concatenated DataFrame
-
concat
Concatenates this DataFrame with another DataFrame along the specified axis using the given join type name.- Parameters:
other- DataFrame to concatenate withaxis- axis along which to concatenatehow- join type name ("outer", "inner")- Returns:
- a new concatenated DataFrame
-
concat
Concatenates this DataFrame with another DataFrame along rows with optional index resetting.- Parameters:
other- DataFrame to concatenate withignoreIndex- whether to reset the index- Returns:
- a new concatenated DataFrame
-
concat
Concatenates this DataFrame with another DataFrame with full control over axis, join type, and index resetting.- Parameters:
other- DataFrame to concatenate withaxis- axis along which to concatenatehow- join typeignoreIndex- whether to reset the index- Returns:
- a new concatenated DataFrame
-
concatHorizontal
Concatenates this DataFrame with another DataFrame horizontally with custom suffixes for colliding columns.- Parameters:
other- DataFrame to concatenate withleftSuffix- suffix for colliding columns from this DataFramerightSuffix- suffix for colliding columns from other DataFrame- Returns:
- a new concatenated DataFrame
-
concatWith
Concatenates this DataFrame with multiple other DataFrames along rows.- Parameters:
others- other DataFrames to concatenate- Returns:
- a new concatenated DataFrame
-
concatWith
Concatenates this DataFrame with a list of other DataFrames along rows.- Parameters:
others- other DataFrames to concatenate- Returns:
- a new concatenated DataFrame
-
concat
-
concat
-
concat
-
concat
-
concat
-
concat
public static IDataFrame concat(List<? extends IDataFrame> frames, ConcatAxis axis, JoinType how, boolean ignoreIndex) -
concat
-
concat
-
concat
-
setHeaders
-
write
-
rolling
-
expanding
-
expanding
-
window
-
cumsum
-
cumprod
-
cummin
-
cummax
-
rolling_mean
-
rolling_mean
-
rolling_sum
-
rolling_sum
-
lead
-
lead
-
lead
-
lag
-
lag
-
lag
-
diff
-
diff
-
diff
-
diff
-
pctChange
-
pctChange
-
pctChange
-
pctChange
-
rank
-
rank
-
denseRank
-
denseRank
-
percentRank
-
percentRank
-
rowNumber
-
rowNumber
-
plot
Obtains a declarative plotting builder for visualizing this DataFrame. Requires the optionalcupoftea-plotmodule on the classpath.- Returns:
- a
Plotinstance
-
plot
Obtains a declarative plotting builder backed by a specific plotting engine.- Parameters:
engine- plotting engine name (e.g. "vegalite")- Returns:
- a
Plotinstance
-
toHtml
Renders this DataFrame as a clean, responsive HTML table with sticky headers, data type indicators, and client-side pagination.- Returns:
- HTML string representation
-
toHtml
Renders this DataFrame as an HTML table displaying up tomaxRowsrows.- Parameters:
maxRows- maximum number of rows to include- Returns:
- HTML string representation
-
toHtml
Renders this DataFrame as an HTML table using the specified configuration.- Parameters:
configuration- table HTML rendering configuration- Returns:
- HTML string representation
-
renderHtml
Jupyter / IJava notebook MIME representation method. Automatically invoked by Jupyter kernels when this DataFrame is evaluated in a cell.- Returns:
- HTML table string
-
render
Jupyter / Polyglot notebook MIME representation bundle.- Returns:
- map mapping MIME type ("text/html") to HTML representation
-