Modify
Naming conventions
DataFrame
is a columnar data structure and is more oriented to column-wise operations. Most transformation operations start with column selector that selects target columns for the operation. Syntax of most column operations assumes that they are applied to columns, so they don't include word column
in their naming.
On the other hand, the Kotlin DataFrame library follows Koltin Collections
naming for row-wise operations as DataFrame
can be interpreted as a Collection
of rows. The slight naming difference with Kotlin Collection
is that all operations are named in imperative way: sortBy
, shuffle
etc.
Pairs of column/row operations:
Horizontal (column) operations:
add — add columns
addId — add
id
columnflatten — remove column groupings recursively
group — group columns into
ColumnGroup
insert — insert column
map — map columns into new
DataFrame
orDataColumn
merge — merge several columns into one
move — move columns or change column groupings
remove — remove columns
rename — rename columns
reorder — reorder columns
replace — replace columns
select — select subset of columns
split — split values into new columns
ungroup — remove column grouping
Vertical (row) operations:
append — add rows
distinct/distinctBy — remove duplicated rows
drop/dropLast/dropWhile/dropNulls/dropNA — remove rows by condition
duplicate — duplicate rows
explode — spread lists and
DataFrame
objects vertically into new rowsimplode — merge column values into lists grouping by other columns
reverse — reverse rows
shuffle — reorder rows randomly
sortBy/sortByDesc/sortWith — sort rows
split — split values into new rows
Value modification:
convert — convert values into new types
parse — try to convert
String
values into appropriate typesunfold — convert / "unfold" objects to
ColumnGroup
update — update values preserving column types
Reshaping:
pivot/pivotCounts/pivotMatches — convert values into new columns
gather — convert pairs of column names and values into
key
andvalue
columns
Learn how to: