File tree Expand file tree Collapse file tree 3 files changed +5
-29
lines changed
core/generated-sources/src
main/kotlin/org/jetbrains/kotlinx/dataframe
test/kotlin/org/jetbrains/kotlinx/dataframe/samples/api Expand file tree Collapse file tree 3 files changed +5
-29
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ import org.jetbrains.kotlinx.dataframe.impl.columns.createComputedColumnReferenc
32
32
import org.jetbrains.kotlinx.dataframe.impl.columns.forceResolve
33
33
import org.jetbrains.kotlinx.dataframe.impl.columns.unbox
34
34
import org.jetbrains.kotlinx.dataframe.size
35
+ import org.jetbrains.kotlinx.dataframe.util.DATAFRAME_OF_WITH_VALUES
35
36
import kotlin.random.Random
36
37
import kotlin.random.nextInt
37
38
import kotlin.reflect.KProperty
@@ -361,6 +362,7 @@ public fun dataFrameOf(header: Iterable<String>): DataFrameBuilder = DataFrameBu
361
362
public fun dataFrameOf (vararg columns : Pair <String , List <Any ?>>): DataFrame <* > =
362
363
columns.map { it.second.toColumn(it.first, Infer .Type ) }.toDataFrame()
363
364
365
+ @Deprecated(DATAFRAME_OF_WITH_VALUES , ReplaceWith (" dataFrameOf(header).withValues(values)" ))
364
366
public fun dataFrameOf (header : Iterable <String >, values : Iterable <Any ?>): DataFrame <* > =
365
367
dataFrameOf(header).withValues(values)
366
368
Original file line number Diff line number Diff line change @@ -163,6 +163,9 @@ internal const val TO_CSV_REPLACE = "this.toCsvStr()"
163
163
internal const val SPLIT_STR =
164
164
" Please explicitly specify how the String should be split. This shortcut will be removed in version 1.1.0"
165
165
166
+ internal const val DATAFRAME_OF_WITH_VALUES =
167
+ " Deprecated in favor of dataFrameOf(names).withValues(values). Will be error in 1.1.0"
168
+
166
169
// endregion
167
170
168
171
// region keep across releases
Original file line number Diff line number Diff line change @@ -336,35 +336,6 @@ class Create : TestBase() {
336
336
// SampleEnd
337
337
}
338
338
339
- @Test
340
- @TransformDataFrameExpressions
341
- fun createDataFrameFromIterable () {
342
- // SampleStart
343
- val name by columnOf(" Alice" , " Bob" , " Charlie" )
344
- val age by columnOf(15 , 20 , 22 )
345
-
346
- listOf (name, age).toDataFrame()
347
- // SampleEnd
348
- }
349
-
350
- @Test
351
- @TransformDataFrameExpressions
352
- fun createDataFrameFromNamesAndValues () {
353
- // SampleStart
354
- val names = listOf (" name" , " age" )
355
- val values = listOf (
356
- " Alice" , 15 ,
357
- " Bob" , 20 ,
358
- " Charlie" , 22 ,
359
- )
360
- val df = dataFrameOf(names, values)
361
- // SampleEnd
362
- df.columnNames() shouldBe listOf (" name" , " age" )
363
- df.rowsCount() shouldBe 3
364
- df[" name" ].type() shouldBe typeOf<String >()
365
- df[" age" ].type() shouldBe typeOf<Int >()
366
- }
367
-
368
339
@Test
369
340
@TransformDataFrameExpressions
370
341
fun readDataFrameFromValues () {
You can’t perform that action at this time.
0 commit comments