Dataframe 0.13 Help

Extension properties API

When DataFrame is used within Jupyter Notebooks or Datalore with Kotlin Kernel, after every cell execution all new global variables of type DataFrame are analyzed and replaced with typed DataFrame wrapper with auto-generated extension properties for data access:

val df = DataFrame.read("titanic.csv")

Now data can be accessed by . member accessor

df.add("lastName") { name.split(",").last() } .dropNulls { age } .filter { survived && home.endsWith("NY") && age in 10..20 }

The titanic.csv file could be found here.

In notebooks, extension properties are generated for DataSchema that is extracted from DataFrame instance after REPL line execution. After that DataFrame variable is typed with its own DataSchema, so only valid extension properties corresponding to actual columns in DataFrame will be allowed by the compiler and suggested by completion.

Extension properties can be generated in IntelliJ IDEA using the Kotlin Dataframe Gradle plugin.

Last modified: 19 March 2024