numero

número

número

A friendly and intuitive math library for p5.js

All Contributors

Build Status

This addon library for p5.js turns the "software sketchbook" into a beginner-friendly environment for technical computing. It provides the following features:

  • A tensor object similar to NumPy arrays
  • A grammar of data manipulation similar to dplyr
  • A machine learning API similar to scikit-learn (coming soon!)
  • A drawing turtle

The library is written in TypeScript and uses TensorFlow.js and tidy.js under the hood. It bundles p5.ten, p5.tidy, TurtleGFX.

Usage

Data Wrangling

View the Mauna Loa example.

let data;

function preload() {
data = loadTable('co2.csv', 'csv', 'header');
}

function setup() {
noCanvas()
tidy(
data,
filter((d) => d.mean > 400),
debug('Observations greater than 400ppm CO2'),
);
}

Tensors

View the matrix-vector example.

const a = createTensor([[1, 2], [3, 4]]);
const x = createTensor([5, 6]);
const b = a.dot(x);

b.print();

Demo

The fluid simulation below was created using a 2-dimensional lattice Boltzmann method.

A fluid simulation

Contributing

See CONTRIBUTING.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Ashneel Das
Ashneel Das

💻 ⚠️

This project follows the all-contributors specification. Contributions of any kind welcome!

Generated using TypeDoc