AKA Yet-Another-Numpy-to-JS-Port.
There are a number numpy-to-JS ports out there that cover a small subset of Numpy, especially on the easier stuff. This project also covers a small subset, but includes some harder to solve ports, and requires no dependencies. There is some overlap with other projects, but all ports in this repo were created due to incomplete or incorrect implementations.
const numpy = require('numpy.js');
Supported functions/classes and docs:
amax
- https://docs.scipy.org/doc/numpy/reference/generated/numpy.amax.htmldigitize
- https://docs.scipy.org/doc/numpy-1.14.0/reference/generated/numpy.digitize.html#numpy.digitizedstack
- https://docs.scipy.org/doc/numpy/reference/generated/numpy.dstack.htmllinspace
- https://docs.scipy.org/doc/numpy/reference/generated/numpy.linspace.htmlmeshgrid
- https://docs.scipy.org/doc/numpy/reference/generated/numpy.meshgrid.htmlndarray.flat
- https://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.flat.htmlnditer
- https://docs.scipy.org/doc/numpy-1.14.0/reference/generated/numpy.nditer.htmlnonzero
- https://docs.scipy.org/doc/numpy-1.14.0/reference/generated/numpy.nonzero.htmlravel_multi_index
- https://docs.scipy.org/doc/numpy/reference/generated/numpy.ravel_multi_index.htmlshape
- https://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.shape.htmlsubtract
- https://docs.scipy.org/doc/numpy-1.14.0/reference/generated/numpy.subtract.htmltranspose
- https://docs.scipy.org/doc/numpy/reference/generated/numpy.transpose.htmlunravel_index
- https://docs.scipy.org/doc/numpy/reference/generated/numpy.unravel_index.html#numpy.unravel_indexvstack
- https://docs.scipy.org/doc/numpy/reference/generated/numpy.vstack.html
npm test
All (> 80) tests were designed and verified against official Python Numpy.
Happy to take contributions. Better yet, if someone wants to own a full port of Numpy, feel free to take what you like.