zebras – data analysis library for javascript

分享分享資料用的 javascript library, zebras
https://github.com/nickslevine/zebras

使用方式, 先下載:

npm install zebras --saveconst z = require("zebras")

Online in an Observable notebook

z = require("zebras")

Example Usage

const z = require("zebras")
const data = z.readCSV("data.csv")
const parsedData = z.parseNums(["speed", "acc"], data)
const speed = z.getCol("speed", parsedData)
const avgSpeed = z.mean(speed)

Note: make sure numerical data imported into Zebras does not contain commas (“2342.5”, not “2,342.5”) – commas within numbers will throw off the parsing and lead to unexpected results.

Piping example:

const z = require("zebras")
const avgSpeed = z.pipe([
// array of functions for input to travel through
z.readCSV,
z.parseNums(["speed", "acc"]),
z.getCol("speed"),
z.mean,
])("data.csv")

範例2: Medical Cost Prediction: JS Edition
https://observablehq.com/@mrpancakes39/medical-cost-prediction-js-edition

zebra 後面, 滿多都是架構在 ramda 的應用:
https://github.com/Ramda/ramda

ramda js:
https://ramdajs.com/

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *