diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/toDataFrame.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/toDataFrame.kt index 4cf7f23198..ec3832563b 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/toDataFrame.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/toDataFrame.kt @@ -232,6 +232,16 @@ public inline fun Iterable.toDataFrame(): DataFrame::value from { it } }.cast() +@JvmName("toDataFrameFloat") +public inline fun Iterable.toDataFrame(): DataFrame> = toDataFrame { + ValueProperty::value from { it } +}.cast() + +@JvmName("toDataFrameDouble") +public inline fun Iterable.toDataFrame(): DataFrame> = toDataFrame { + ValueProperty::value from { it } +}.cast() + @JvmName("toDataFrameUByte") public inline fun Iterable.toDataFrame(): DataFrame> = toDataFrame { ValueProperty::value from { it } diff --git a/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/toDataFrame.kt b/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/toDataFrame.kt index 0b42c3dc47..f5247ccc64 100644 --- a/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/toDataFrame.kt +++ b/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/toDataFrame.kt @@ -223,6 +223,12 @@ class CreateDataFrameTests { val int = listOf(1, 2, 3) int.toDataFrame().alsoDebug() shouldBe dataFrameOf("value")(*int.toTypedArray()) + + val doubles = listOf(1.0, 2.0, 3.0) + doubles.toDataFrame().alsoDebug() shouldBe dataFrameOf("value")(*doubles.toTypedArray()) + + val floats = listOf(1.0f, 2.0f, 3.0f) + floats.toDataFrame().alsoDebug() shouldBe dataFrameOf("value")(*floats.toTypedArray()) } @Ignore