File tree Expand file tree Collapse file tree 2 files changed +16
-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 +16
-0
lines changed Original file line number Diff line number Diff line change @@ -232,6 +232,16 @@ public inline fun <reified B : Boolean?> Iterable<B>.toDataFrame(): DataFrame<Va
232
232
ValueProperty <B >::value from { it }
233
233
}.cast()
234
234
235
+ @JvmName(" toDataFrameFloat" )
236
+ public inline fun <reified F : Float ? > Iterable<F>.toDataFrame (): DataFrame <ValueProperty <F >> = toDataFrame {
237
+ ValueProperty <F >::value from { it }
238
+ }.cast()
239
+
240
+ @JvmName(" toDataFrameDouble" )
241
+ public inline fun <reified D : Double ? > Iterable<D>.toDataFrame (): DataFrame <ValueProperty <D >> = toDataFrame {
242
+ ValueProperty <D >::value from { it }
243
+ }.cast()
244
+
235
245
@JvmName(" toDataFrameUByte" )
236
246
public inline fun <reified U : UByte ? > Iterable<U>.toDataFrame (): DataFrame <ValueProperty <U >> = toDataFrame {
237
247
ValueProperty <U >::value from { it }
Original file line number Diff line number Diff line change @@ -223,6 +223,12 @@ class CreateDataFrameTests {
223
223
224
224
val int = listOf (1 , 2 , 3 )
225
225
int.toDataFrame().alsoDebug() shouldBe dataFrameOf(" value" )(* int.toTypedArray())
226
+
227
+ val doubles = listOf (1.0 , 2.0 , 3.0 )
228
+ doubles.toDataFrame().alsoDebug() shouldBe dataFrameOf(" value" )(* doubles.toTypedArray())
229
+
230
+ val floats = listOf (1.0f , 2.0f , 3.0f )
231
+ floats.toDataFrame().alsoDebug() shouldBe dataFrameOf(" value" )(* floats.toTypedArray())
226
232
}
227
233
228
234
@Ignore
You can’t perform that action at this time.
0 commit comments