File tree Expand file tree Collapse file tree 5 files changed +10
-5
lines changed
generated-sources/src/test/kotlin/org/jetbrains/kotlinx/dataframe
src/test/kotlin/org/jetbrains/kotlinx/dataframe Expand file tree Collapse file tree 5 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -630,6 +630,7 @@ class Access : TestBase() {
630
630
df.select { age and name }
631
631
df.fillNaNs { dfsOf<Double >() }.withZero()
632
632
df.remove { cols { it.hasNulls() } }
633
+ df.group { cols { it.data != name } }.into { " nameless" }
633
634
df.update { city }.notNull { it.lowercase() }
634
635
df.gather { colsOf<Number >() }.into(" key" , " value" )
635
636
df.move { name.firstName and name.lastName }.after { city }
@@ -790,6 +791,7 @@ class Access : TestBase() {
790
791
791
792
@Test
792
793
fun columnSelectorsMisc () {
794
+ val df = df.add { " year" from { 0 } }
793
795
// SampleStart
794
796
// by condition
795
797
df.select { cols { it.name().startsWith(" year" ) } }
@@ -813,7 +815,7 @@ class Access : TestBase() {
813
815
df.select { dropLast(2 ) }
814
816
815
817
// find the first column satisfying the condition
816
- df.select { first { it.name() .startsWith(" year" ) } }
818
+ df.select { first { it.name.startsWith(" year" ) } }
817
819
818
820
// find the last column inside a column group satisfying the condition
819
821
df.select {
Original file line number Diff line number Diff line change @@ -1395,7 +1395,7 @@ class DataFrameTests : BaseTest() {
1395
1395
).toDataFrame().cast<Person >()
1396
1396
res shouldBe typed
1397
1397
}
1398
- typed.group { cols { it != name } }.into { it.type.jvmErasure.simpleName!! }.check()
1398
+ typed.group { cols { it.data != name } }.into { it.type.jvmErasure.simpleName!! }.check()
1399
1399
typed.group { age and city and weight }.into { it.type.jvmErasure.simpleName!! }.check()
1400
1400
}
1401
1401
Original file line number Diff line number Diff line change @@ -630,6 +630,7 @@ class Access : TestBase() {
630
630
df.select { age and name }
631
631
df.fillNaNs { dfsOf<Double >() }.withZero()
632
632
df.remove { cols { it.hasNulls() } }
633
+ df.group { cols { it.data != name } }.into { " nameless" }
633
634
df.update { city }.notNull { it.lowercase() }
634
635
df.gather { colsOf<Number >() }.into(" key" , " value" )
635
636
df.move { name.firstName and name.lastName }.after { city }
@@ -790,6 +791,7 @@ class Access : TestBase() {
790
791
791
792
@Test
792
793
fun columnSelectorsMisc () {
794
+ val df = df.add { " year" from { 0 } }
793
795
// SampleStart
794
796
// by condition
795
797
df.select { cols { it.name().startsWith(" year" ) } }
@@ -813,7 +815,7 @@ class Access : TestBase() {
813
815
df.select { dropLast(2 ) }
814
816
815
817
// find the first column satisfying the condition
816
- df.select { first { it.name() .startsWith(" year" ) } }
818
+ df.select { first { it.name.startsWith(" year" ) } }
817
819
818
820
// find the last column inside a column group satisfying the condition
819
821
df.select {
Original file line number Diff line number Diff line change @@ -1395,7 +1395,7 @@ class DataFrameTests : BaseTest() {
1395
1395
).toDataFrame().cast<Person >()
1396
1396
res shouldBe typed
1397
1397
}
1398
- typed.group { cols { it != name } }.into { it.type.jvmErasure.simpleName!! }.check()
1398
+ typed.group { cols { it.data != name } }.into { it.type.jvmErasure.simpleName!! }.check()
1399
1399
typed.group { age and city and weight }.into { it.type.jvmErasure.simpleName!! }.check()
1400
1400
}
1401
1401
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ Column selectors are used in many operations:
12
12
df.select { age and name }
13
13
df.fillNaNs { dfsOf<Double >() }.withZero()
14
14
df.remove { cols { it.hasNulls() } }
15
+ df.group { cols { it.data != name } }.into { " nameless" }
15
16
df.update { city }.notNull { it.lowercase() }
16
17
df.gather { colsOf<Number >() }.into(" key" , " value" )
17
18
df.move { name.firstName and name.lastName }.after { city }
@@ -207,7 +208,7 @@ df.select { drop(2) }
207
208
df.select { dropLast(2 ) }
208
209
209
210
// find the first column satisfying the condition
210
- df.select { first { it.name() .startsWith(" year" ) } }
211
+ df.select { first { it.name.startsWith(" year" ) } }
211
212
212
213
// find the last column inside a column group satisfying the condition
213
214
df.select {
You can’t perform that action at this time.
0 commit comments