The readCSV method can read a CSV file from a local disk, or over the internet (URL). Reading of local files is only supported in Nodejs, while reading of input file objects is only supported in the browser.
Reading files from local disk
By specifying a valid file path, you can load CSV files from local disk:
constdfd=require("danfojs-node")dfd.readCSV("./user_names.csv") //assumes file is in CWD.then(df => {df.head().print() }).catch(err=>{console.log(err); })
Reading files from a URL
By specifying a valid URL, you can load CSV files from any location into Danfo**'**s data structure:
constdfd=require("danfojs-node")dfd.readCSV("https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv") //assumes file is in CWD
.then(df => {df.head().print() }).catch(err=>{console.log(err); })