ndarray-js
ndarray-js is a reimplementation of numpy for javascript that aims to make the coding experience as similar to numpy as possible.
In html:
<script src="https://cdn.jsdelivr.net/npm/ndarray-js@latest/dist/index.js"></script><script>a = np.arange(18).reshape(3, 2, 3);console.log(a.tolist());</script> Copy
<script src="https://cdn.jsdelivr.net/npm/ndarray-js@latest/dist/index.js"></script><script>a = np.arange(18).reshape(3, 2, 3);console.log(a.tolist());</script>
Or press F12 and play with the browser console directly.
Installation:
npm install ndarray-js Copy
npm install ndarray-js
Use in nodejs with require:
const { np } = require('ndarray-js');a = np.arange(18).reshape(3, 2, 3);console.log(a.tolist()); Copy
const { np } = require('ndarray-js');a = np.arange(18).reshape(3, 2, 3);console.log(a.tolist());
Use in nodejs with typescript (run with ts-node or compile with tsc):
import { np } from 'ndarray-js';const a = np.arange(18).reshape(3, 2, 3);console.log(a.tolist()); Copy
import { np } from 'ndarray-js';const a = np.arange(18).reshape(3, 2, 3);console.log(a.tolist());
You need to install the ipykernel (the setup is a bit more complex).
Example notebook: https://github.com/caph1993/numpy-js/blob/main/notebooks/normal-scatter.ipynb
Generated using TypeDoc
Description
Welcome to the documentation of
ndarray-js
ndarray-js is a reimplementation of numpy for javascript that aims to make the coding experience as similar to numpy as possible.
Interactive demo:
Errors:
Console output:
SVG outputs:
API Index
Browser usage
In html:
Or press F12 and play with the browser console directly.
Node usage
Installation:
Use in nodejs with require:
Use in nodejs with typescript (run with ts-node or compile with tsc):
Use in Jupyter notebooks:
You need to install the ipykernel (the setup is a bit more complex).
Example notebook: https://github.com/caph1993/numpy-js/blob/main/notebooks/normal-scatter.ipynb