dataFrameOf
Example:
@DataSchema
data class Person(val name: String, val age: Int)
fun main() {
val df = dataFrameOf(Person("Alice", 30), Person("Bob", 25))
val dfWithCarol = df.append(Person("Carol", 25))
}Content copied to clipboard
Creates new DataFrame with given columns.
All named columns must have unique names. For columns with empty names unique column names are generated: "untitled", "untitled1", "untitled2" etc.
All columns must have equal sizes.
For more information: See dataFrameOf on the documentation website.
Parameters
columns
columns for DataFrame
Throws
if column names are not unique
if column sizes are not equal
See dataFrameOf on the documentation website.
Example:
val df = dataFrameOf(
"a" to columnOf(1, 2),
"b" to columnOf(1.0, 2.0),
"group" to columnOf(
"nestedA" to columnOf("42", "abc"),
)
)Content copied to clipboard
inline fun <reified C> dataFrameOf(vararg header: String, crossinline fill: (String) -> Iterable<C>): DataFrame<*>
Deprecated
Deprecated in favor of dataFrameOf(names).withValues(values). Will be ERROR in 1.1.
Replace with
dataFrameOf(header).withValues(values)Content copied to clipboard