Paulo Cereda
07/05/2024, 6:42 PMval profileOptions = ParserOptions(
locale = Locale.UK,
dateTimePattern = "MM-dd-yyyy",
)
val profileTypes = mapOf(
"Date" to ColType.LocalDate,
"Network" to ColType.String,
"Audience" to ColType.Int,
)
DataFrame.readCSV("profile.csv", parserOptions = profileOptions, colTypes = profileTypes)
The .csv
I have has comma as group separator/thousand separator (that's why I went for Locale.UK
). If I don't specify the type for Audience
, DataFrame infers it's a Double
, then later I can convert it to Int
. I was trying to specify Int
as column type to save me one conversion, but it seems the locale is not considered:
Exception in thread "main" java.lang.IllegalStateException: Couldn't parse '52,487' into type kotlin.Int
I can live with an extra .convert { ... }
line to convert this double to int, but I was wondering if I missed something here (or if it's not possible at all). Any ideas are welcome! Thanks! gratitude thank youross_a
07/06/2024, 7:22 AMPaulo Cereda
07/06/2024, 1:06 PM