krangl / krangl / rowsAs

rowsAs

fun <reified T> DataFrame.rowsAs(mapping: Map<String, String> = names.map { it to it }.toMap()): Iterable<T>

Convert rows into objects by using reflection. Only parameters used in constructor will be mapped. Note: This is tested with kotlin data classes only. File a ticket for better type compatibility or any issues!

Parameters

mapping - parameter mapping scheme to link data frame columns to object properties mapOf("someName" to "lastName", etc.)