File tree Expand file tree Collapse file tree 6 files changed +10
-22
lines changed
main/kotlin/org/jetbrains/kotlinx/dataframe
test/kotlin/org/jetbrains/kotlinx/dataframe/samples/api
examples/kotlin-dataframe-plugin-example/src/main/kotlin/org/jetbrains/kotlinx/dataframe/examples/plugin Expand file tree Collapse file tree 6 files changed +10
-22
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ public fun <T> DataColumn<T>.any(predicate: Predicate<T>): Boolean = values.any(
4141 * @param predicate A [RowFilter] lambda that takes a [DataRow] (as both `this` and `it`)
4242 * and returns `true` if the row should be considered a match.
4343 * @return `true` if at least one row satisfies the [predicate], `false` otherwise.
44+ * @see [DataFrame.all]
4445 */
4546public inline fun <T > DataFrame<T>.any (predicate : RowFilter <T >): Boolean = rows().any { predicate(it, it) }
4647
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import org.jetbrains.kotlinx.dataframe.impl.between
77
88/* *
99 * Returns a [DataColumn] of [Boolean] values indicating whether each element
10- * lies between [left] and [right].
10+ * in this column lies between [left] and [right].
1111 *
1212 * If [includeBoundaries] is `true` (default), values equal to [left] or [right] are also considered in range.
1313 *
Original file line number Diff line number Diff line change 11package org.jetbrains.kotlinx.dataframe.api
22
33import org.jetbrains.kotlinx.dataframe.DataFrame
4- import org.jetbrains.kotlinx.dataframe.util.TAIL
5- import org.jetbrains.kotlinx.dataframe.util.TAIL_REPLACE
64
75// region DataFrame
86
9- @Deprecated(TAIL , ReplaceWith (TAIL_REPLACE ), DeprecationLevel .ERROR )
7+ /* *
8+ * Returns a DataFrame containing the last [numRows] rows.
9+ *
10+ * Equivalent to [takeLast].
11+ *
12+ * @param numRows The number of rows to return from the end of the DataFrame. Defaults to 5.
13+ * @return A DataFrame containing the last [numRows] rows.
14+ */
1015public fun <T > DataFrame<T>.tail (numRows : Int = 5): DataFrame <T > = takeLast(numRows)
1116
1217// endregion
Original file line number Diff line number Diff line change @@ -139,9 +139,6 @@ internal const val COL_TYPE_INSTANT =
139139 " kotlinx.datetime.Instant is deprecated in favor of kotlin.time.Instant. Either migrate to kotlin.time.Instant and use ColType.StdlibInstant or use ColType.DeprecatedInstant. $MESSAGE_1_0 and migrated to kotlin.time.Instant in 1.1."
140140internal const val COL_TYPE_INSTANT_REPLACE = " ColType.DeprecatedInstant"
141141
142- internal const val TAIL = " This function will be removed in favor of `takeLast()`. $MESSAGE_1_0 "
143- internal const val TAIL_REPLACE = " this.takeLast(numRows)"
144-
145142// endregion
146143
147144// region WARNING in 1.0, ERROR in 1.1
Original file line number Diff line number Diff line change @@ -78,19 +78,6 @@ class Create : TestBase() {
7878 // SampleEnd
7979 }
8080
81- // Not used anymore
82- /* @Test
83- @TransformDataFrameExpressions
84- fun columnAccessorToColumn() {
85- // SampleStart
86- val age by column<Int>()
87- val ageCol1 = age.withValues(15, 20)
88- val ageCol2 = age.withValues(1..10)
89- // SampleEnd
90-
91- ageCol2.size() shouldBe 10
92- }*/
93-
9481 @Test
9582 @TransformDataFrameExpressions
9683 fun columnAccessorMap () {
Original file line number Diff line number Diff line change @@ -6,11 +6,9 @@ import org.jetbrains.kotlinx.dataframe.api.add
66import org.jetbrains.kotlinx.dataframe.api.convert
77import org.jetbrains.kotlinx.dataframe.api.convertTo
88import org.jetbrains.kotlinx.dataframe.api.filter
9- import org.jetbrains.kotlinx.dataframe.api.insert
109import org.jetbrains.kotlinx.dataframe.api.into
1110import org.jetbrains.kotlinx.dataframe.api.rename
1211import org.jetbrains.kotlinx.dataframe.api.renameToCamelCase
13- import org.jetbrains.kotlinx.dataframe.api.under
1412import org.jetbrains.kotlinx.dataframe.api.with
1513import org.jetbrains.kotlinx.dataframe.io.readCsv
1614import org.jetbrains.kotlinx.dataframe.io.writeCsv
You can’t perform that action at this time.
0 commit comments