Skip to content

Commit dfe149d

Browse files
committed
added first and last to docs
1 parent 7cdd652 commit dfe149d

File tree

3 files changed

+24
-0
lines changed
  • core
    • generated-sources/src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/api
    • src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/api
  • docs/StardustDocs/topics

3 files changed

+24
-0
lines changed

core/generated-sources/src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/api/Access.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,14 @@ class Access : TestBase() {
812812
df.select { drop(2) }
813813
df.select { dropLast(2) }
814814

815+
// find the first column satisfying the condition
816+
df.select { first { it.name().startsWith("year") } }
817+
818+
// find the last column inside a column group satisfying the condition
819+
df.select {
820+
group("name").last { it.name().endsWith("Name") }
821+
}
822+
815823
// depth-first-search traversal of all columns, excluding ColumnGroups from result
816824
df.select { allDfs() }
817825

core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/api/Access.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,14 @@ class Access : TestBase() {
812812
df.select { drop(2) }
813813
df.select { dropLast(2) }
814814

815+
// find the first column satisfying the condition
816+
df.select { first { it.name().startsWith("year") } }
817+
818+
// find the last column inside a column group satisfying the condition
819+
df.select {
820+
group("name").last { it.name().endsWith("Name") }
821+
}
822+
815823
// depth-first-search traversal of all columns, excluding ColumnGroups from result
816824
df.select { allDfs() }
817825

docs/StardustDocs/topics/ColumnSelectors.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,14 @@ df.select { takeLast(2) }
206206
df.select { drop(2) }
207207
df.select { dropLast(2) }
208208

209+
// find the first column satisfying the condition
210+
df.select { first { it.name().startsWith("year") } }
211+
212+
// find the last column inside a column group satisfying the condition
213+
df.select {
214+
group("name").last { it.name().endsWith("Name") }
215+
}
216+
209217
// depth-first-search traversal of all columns, excluding ColumnGroups from result
210218
df.select { allDfs() }
211219

0 commit comments

Comments
 (0)