Columns Selection DSL Overhaul (Discussion ended) #396
Replies: 13 comments 28 replies
-
New: ColumnSet / SingleColumn Split |
Beta Was this translation helpful? Give feedback.
-
New: Streamlined behavior for functions on SingleColumn<DataRow<*>> v/s ColumnSet |
Beta Was this translation helpful? Give feedback.
-
Question: Split plain DSL calls from SingleColumn functions? |
Beta Was this translation helpful? Give feedback.
-
Question: KProperty<DataRow<*>>.function() or KProperty<*>.function()? |
Beta Was this translation helpful? Give feedback.
-
Question: All, Cols, Children overlap and differences |
Beta Was this translation helpful? Give feedback.
-
Question: String/ColumnPath, allow group calls directly on it or only on |
Beta Was this translation helpful? Give feedback.
-
Question: cols {} vs filter {} |
Beta Was this translation helpful? Give feedback.
-
Question: What to do with Except? |
Beta Was this translation helpful? Give feedback.
-
Question: If |
Beta Was this translation helpful? Give feedback.
-
Question: What to do about Select/Cols overlap? |
Beta Was this translation helpful? Give feedback.
-
New: Recursively (with Question) |
Beta Was this translation helpful? Give feedback.
-
You missed {} vs [] |
Beta Was this translation helpful? Give feedback.
-
Personally I find that if the dataframe API is too different from the standard Kotlin collection API's, it is hard to remember the usage patterns (especially when not using it every day). In my mental picture, a dataframe is just a columnar storage. So I would like to have normal Kotlin collection familiar access patterns over these columns. The following code-snippet shows how a dataframe looks in my head, and the kind of column access patterns I would expect: data class Col<T>(val name: String, val rows: List<T>)
class DataFrame(vararg val cols: Col<*>)
val df = DataFrame(
Col("name", listOf("Peter", "John")),
Col("age", listOf(50, 25))
)
// Some access patterns
df.cols.filterIsInstance<Col<Int>>().forEach { println(it.rows) }
df.cols.filter { it.name.contains('a') }.forEach { println(it.name) }
val floatColumns = df.cols.filterIsInstance<Col<Float>>()
floatColumns.forEach { it.rows.max() } BTW, I only use dataframes now and then, so for sure I'm not a power user. |
Beta Was this translation helpful? Give feedback.
-
Hi everyone!
While working on the Columns Selection DSL, which is an integral part of the library, I found many inconsistencies and took it upon myself to fix that. I documented almost every function and reworked all overloads, but I still have doubts about some.
So, I collected these concerns in a helpful Kotlin Notebook for you to experience and judge! The notebook imports a proposal version of DataFrame based on the extensive PR, so you can experience the changes firsthand.
The data used for the example can be found here and to view and run the notebook, I recommend the Kotlin Notebook Plugin for IntelliJ.
You can also use Datalore or the Kotlin Jupyter kernel, but then you'd miss out on the new and extensive KDocs, so I wouldn't recommend that.
Please leave your feedback below in the corresponding thread below. I'm curious to hear your feedback! Also, feel free to leave any questions below as well if my notebook isn't clear enough in explaining the issues.
Beta Was this translation helpful? Give feedback.
All reactions