https://kotlinlang.org logo
#datascience
Title
# datascience
h

holgerbrandl

11/04/2023, 7:22 AM
I stumbled over
Copy code
DataFrame.readDelim(
        SleepPattern::class.java.getResourceAsStream("/data/iris.txt")!!,
        csvType = CSVType.TDF,
        delimiter = '\t'
    )
Without the seemingly redundant
delimiter
argument, it wont read the file correctly (but still reading with
,
as delimiter) . I know there is also
readTsv
but
readDelim
is sometimes handy as well. Is this a bug?
n

Nikita Klimenko [JB]

11/06/2023, 2:24 PM
Kind of bug, yes. Looks like in this overload
delimeter
overrides
csvType
. For another,
csvType
will work:
Copy code
public fun DataFrame.Companion.readDelim(
    reader: Reader,
    format: CSVFormat = CSVFormat.DEFAULT.withHeader(),
    colTypes: Map<String, ColType> = mapOf(),
    skipLines: Int = 0,
    readLines: Int? = null,
    parserOptions: ParserOptions? = null,
): AnyFrame
I wouldn't say it's intended, should be fixed