Skip to content

javascript-machine-learning/csv-to-array-matrix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CSV to Matrix

Build Status

A simple CVS to Matrix parser - reads a CSV file, outputs an arrays in array (Matrix).

Installation

npm install csv-to-array-matrix

Usage

import csvToMatrix  from 'csv-to-array-matrix';

csvToMatrix('./src/data.csv', callback);

function callback(data) {
  console.log(data);
}

Transforming into a Matrix object with math.js.

import math from 'mathjs';
import csvToMatrix  from 'csv-to-array-matrix';

csvToMatrix(pathToFile, callback);

function callback(data) {
  const matrix = math.matrix(data);
}

The default delimiter is ';', but you use a different one.

import csvToMatrix  from 'csv-to-array-matrix';

csvToMatrix('./src/data.csv', callback, ',');

function callback(data) {
  console.log(data);
}

About

🔨 A simple CSV to arrays in array (matrix) parser.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published