File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
main/kotlin/org/jetbrains/kotlinx/dataframe/api
test/kotlin/org/jetbrains/kotlinx/dataframe/api Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change 1
1
package org.jetbrains.kotlinx.dataframe.api
2
2
3
+ import org.jetbrains.kotlinx.dataframe.DataColumn
3
4
import org.jetbrains.kotlinx.dataframe.DataFrame
4
5
import org.jetbrains.kotlinx.dataframe.DataRow
6
+ import org.jetbrains.kotlinx.dataframe.Predicate
5
7
import org.jetbrains.kotlinx.dataframe.RowFilter
6
8
import org.jetbrains.kotlinx.dataframe.columns.ColumnSet
7
9
import org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver
10
+ import org.jetbrains.kotlinx.dataframe.columns.size
11
+ import org.jetbrains.kotlinx.dataframe.columns.values
8
12
import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate
9
13
import org.jetbrains.kotlinx.dataframe.impl.columns.ColumnListImpl
10
14
15
+ // region DataColumn
16
+
17
+ /* * Returns `true` if none of the [values] match the given [predicate] or [values] is empty. */
18
+ public fun <T > DataColumn<T>.none (predicate : Predicate <T >): Boolean = values.none(predicate)
19
+
20
+ // endregion
21
+
11
22
// region DataFrame
12
23
13
24
/* *
Original file line number Diff line number Diff line change @@ -18,6 +18,13 @@ class UtilFunctionsTest : TestBase() {
18
18
ageCol.any { it > 90 } shouldBe false
19
19
}
20
20
21
+ @Test
22
+ fun `DataColumn none` () {
23
+ val ageCol = df[" age" ] as DataColumn <Int >
24
+ ageCol.none { it > 40 } shouldBe false
25
+ ageCol.none { it > 90 } shouldBe true
26
+ }
27
+
21
28
@Test
22
29
fun `DataFrame any` () {
23
30
df.any { " age" <Int >() > 40 && " isHappy" <Boolean >() } shouldBe true
You can’t perform that action at this time.
0 commit comments