Skip to content

Commit fbe7a30

Browse files
committed
Inline column/columnOf usages in split.md
1 parent 63c8c37 commit fbe7a30

2 files changed

Lines changed: 12 additions & 14 deletions

File tree

  • core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/api
  • docs/StardustDocs/topics

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -536,9 +536,7 @@ class Modify : TestBase() {
536536
@TransformDataFrameExpressions
537537
fun splitRegex1() {
538538
// SampleStart
539-
val name by column<String>()
540-
541-
merged.split { name }
539+
merged.split { "name"<String>() }
542540
.match("""(.*) \((.*)\)""")
543541
.inward("firstName", "lastName")
544542
// SampleEnd
@@ -557,11 +555,12 @@ class Modify : TestBase() {
557555
7, 8,
558556
9, 10,
559557
)
560-
val group by columnOf(df1, df2)
561-
val id by columnOf("x", "y")
562-
val df = dataFrameOf(id, group)
558+
val df = dataFrameOf(
559+
"id" to columnOf("x", "y"),
560+
"group" to columnOf(df1, df2)
561+
)
563562

564-
df.split { group }.intoColumns()
563+
df.split { "group"<AnyFrame>() }.intoColumns()
565564
// SampleEnd
566565
}
567566

docs/StardustDocs/topics/split.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,7 @@ df.split { "name"["lastName"]<String>() }
112112
<!---FUN splitRegex1-->
113113

114114
```kotlin
115-
val name by column<String>()
116-
117-
merged.split { name }
115+
merged.split { "name"<String>() }
118116
.match("""(.*) \((.*)\)""")
119117
.inward("firstName", "lastName")
120118
```
@@ -136,11 +134,12 @@ val df2 = dataFrameOf("a", "b")(
136134
7, 8,
137135
9, 10,
138136
)
139-
val group by columnOf(df1, df2)
140-
val id by columnOf("x", "y")
141-
val df = dataFrameOf(id, group)
137+
val df = dataFrameOf(
138+
"id" to columnOf("x", "y"),
139+
"group" to columnOf(df1, df2)
140+
)
142141

143-
df.split { group }.intoColumns()
142+
df.split { "group"<AnyFrame>() }.intoColumns()
144143
```
145144

146145
<!---END-->

0 commit comments

Comments
 (0)