holgerbrandl / krangl

krangl is a {K}otlin DSL for data w{rangl}ing
MIT License
560 stars 50 forks source link

java.lang.NullPointerException when using DataFrame.fromCSV() #19

Closed petitgrizzlies closed 6 years ago

petitgrizzlies commented 7 years ago

Hi,

here is my code :

import krangl.*

fun test(pathCSV: String) {
    // Create data-frame  in memory
    val otherDF = DataFrame.fromCSV(pathCSV)
    otherDF.print(colNames = true)
}

I just try to load a csv file into a dataframe having the filepath. The considered file look like ; head -n 8 iris.csv :

sepal_length,sepal_width,petal_length,petal_width,species
5.1,3.5,1.4,0.2,Iris-setosa
4.9,3.0,1.4,0.2,Iris-setosa
4.7,3.2,1.3,0.2,Iris-setosa
4.6,3.1,1.5,0.2,Iris-setosa
5.0,3.6,1.4,0.2,Iris-setosa
5.4,3.9,1.7,0.4,Iris-setosa
4.6,3.4,1.4,0.3,Iris-setosa
5.0,3.4,1.5,0.2,Iris-setosa

And i get this error at runtime :

Exception in thread "main" java.lang.NullPointerException
        at krangl.TableIOKt.fromCSV(TableIO.kt:57)
        at krangl.TableIOKt.fromCSV(TableIO.kt:35)
        at krangl.TableIOKt.fromCSV$default(TableIO.kt:25)
        at krangl.TableIOKt.fromCSV(TableIO.kt:18)
        at com.mycompany.dataframes.DataFrameKt.test(DataFrame.kt:15)
        at com.mycompany.controler.ControlerKt.main(Controler.kt:34)

If you have some answer or advice. Thanks. p.s: I already read it with some Python code , using Pandas library.

holgerbrandl commented 7 years ago

hmm, works perfectly for me. What OS and krangl and kotlin version are you using?

holgerbrandl commented 6 years ago

closed due to missing feedback.