File tree 2 files changed +10
-0
lines changed
generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api
src/main/kotlin/org/jetbrains/kotlinx/dataframe/api
2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -3,15 +3,20 @@ package org.jetbrains.kotlinx.dataframe.api
3
3
import org.jetbrains.kotlinx.dataframe.DataColumn
4
4
import org.jetbrains.kotlinx.dataframe.DataFrame
5
5
import org.jetbrains.kotlinx.dataframe.indices
6
+ import kotlin.random.Random
6
7
7
8
// region DataColumn
8
9
10
+ public fun <T > DataColumn<T>.shuffle (random : Random ): DataColumn <T > = get(indices.shuffled(random))
11
+
9
12
public fun <T > DataColumn<T>.shuffle (): DataColumn <T > = get(indices.shuffled())
10
13
11
14
// endregion
12
15
13
16
// region DataFrame
14
17
18
+ public fun <T > DataFrame<T>.shuffle (random : Random ): DataFrame <T > = getRows(indices.shuffled(random))
19
+
15
20
public fun <T > DataFrame<T>.shuffle (): DataFrame <T > = getRows(indices.shuffled())
16
21
17
22
// endregion
Original file line number Diff line number Diff line change @@ -3,15 +3,20 @@ package org.jetbrains.kotlinx.dataframe.api
3
3
import org.jetbrains.kotlinx.dataframe.DataColumn
4
4
import org.jetbrains.kotlinx.dataframe.DataFrame
5
5
import org.jetbrains.kotlinx.dataframe.indices
6
+ import kotlin.random.Random
6
7
7
8
// region DataColumn
8
9
10
+ public fun <T > DataColumn<T>.shuffle (random : Random ): DataColumn <T > = get(indices.shuffled(random))
11
+
9
12
public fun <T > DataColumn<T>.shuffle (): DataColumn <T > = get(indices.shuffled())
10
13
11
14
// endregion
12
15
13
16
// region DataFrame
14
17
18
+ public fun <T > DataFrame<T>.shuffle (random : Random ): DataFrame <T > = getRows(indices.shuffled(random))
19
+
15
20
public fun <T > DataFrame<T>.shuffle (): DataFrame <T > = getRows(indices.shuffled())
16
21
17
22
// endregion
You can’t perform that action at this time.
0 commit comments