dave08
06/17/2024, 12:08 PMvalue class
that's displayed as a percentage, but can be plotted).. maybe even if I could just specify the columns that have such values?Nikita Klimenko [JB]
06/17/2024, 5:08 PMdf.convert { col1 and col2 }.with { TODO() }
More complex selector can help to convert all suitable columns
// Just for reference, need to create an actual value class here
fun String.toPercentageOrNull() = if(endsWith("%")) dropLast(1).toIntOrNull() else null
dataFrameOf("a","b")("55%", "12%").convert {
colsAtAnyDepth()
.colsOf<String>()
.filter {
it.values().all { it.toPercentageOrNull() != null }
}
}.with { it.toPercentageOrNull()!! }