dataframe
dataframe copied to clipboard
Give schema type along with read function
As far as I can tell, the DataFrame.readCSV()
functionality has very limited ability to specify the schema.
For example, there is already the following functionality:
data class Person(val name: String, val age: Int)
val persons = listOf(Person("Alice", 15), Person("Bob", 20), Person("Charlie", 22))
val df = persons.toDataFrame()
This creates a DataFrame<Person>
instance.
How about something like:
DataFrame<Person>.readCSV(...)
I know that we can use a cast<Person>()
, but why not permit the functionality by default and avoid casting.