ndarray/tensor data processing for modern browsers

Overview

nadder

Easy n-dimensional data manipulation with NumPy syntax.

Installation

npm i nadder # or yarn add nadder, or pnpm add nadder

Usage

import { ndarray, array, add, evaluate, arange } from 'nadder';

const dataSource = new Float32Array(1_000_000);
// load data into dataSource manually here...

// Initialize (1000, 1000) ndarray
const t = ndarray(dataSource, [1000, 1000]);

// NumPy slicing fully supported
console.log(t['100:110, 305:300:-1']);

t['..., :100'] = 1.23;

// np.newaxis is now +
console.log(t['0, 0, +']);

const leapYears = Array.from(
    { length: 1000 },
    (_, i) => i % 4 == 0 && (i % 400 == 0 || i % 100 != 0)
);

// nadder.array automatically creates an efficient representation of your
// Array object and translates nested lists into dimensions in the ndarray
const boolIndex = array(leapYears);

// You can even use other ndarrays in the indices!

console.log(t[`..., ${boolIndex}`]);

// You can evaluate things using a Python-esque DSL
console.log(evaluate`${t}[:, 0] * 2 + 1 / ${arange(1000)}`)

// ufuncs also supported through explicit syntax
// broadcasting, typecasting done automatically
console.log(add(t, boolIndex));

Features

  • Ergonomic NumPy slicing, broadcasting
    • All NumPy bracket syntax and indexing routines supported
  • NumPy syntax and evaluation via evaluate
    • Full support for arithmetic, advanced ops, etc.
  • Tiny: 20kB minified, 8kB gzipped
  • Performant view-based manipulation; minimal copying
  • Fast bitset-backed boolean ndarrays
  • Interleaved complex numbers
  • Arithmetic, algebraic, and trigonometric operations for real and complex numbers
  • Full TypeScript support
  • In progress: support for most NumPy manipulations, more fast paths for higher performance, fast WASM modules

Limitations

  • No direct Fortran (column-major) memory layout support
  • Limited Complex64 support (Complex128 fully supported)

License

MIT

You might also like...

A fast, vanilla JS customisable select box/text input plugin for modern browsers ⚡

choices A fast, vanilla, lightweight (~16kb gzipped 🎉 ), configurable select plugin for modern browsers. Similar to Select2 and Selectize but without

Aug 9, 2022

A tiny, lightning fast jQuery-like library for modern browsers.

Sprint.js Sprint is a high-performance, 5KB (gzipped) DOM library for modern browsers. Sprint notably shines on bandwidth and resource constrained dev

Jan 3, 2023

Zepto.js is a minimalist JavaScript library for modern browsers, with a jQuery-compatible API

Zepto.js – a minimalist JavaScript library Zepto is a minimalist JavaScript library for modern browsers with a largely jQuery-compatible API. If you u

Dec 31, 2022

Reorderable drag-and-drop lists for modern browsers and touch devices. No jQuery or framework required.

Sortable Sortable is a JavaScript library for reorderable drag-and-drop lists. Demo: http://sortablejs.github.io/Sortable/ Features Supports touch dev

Jan 5, 2023

A simple color picker application written in pure JavaScript, for modern browsers.

A simple color picker application written in pure JavaScript, for modern browsers.

Color Picker A simple color picker application written in pure JavaScript, for modern browsers. Has support for touch events. Touchy… touchy… Demo and

Dec 14, 2022

Minecraft 1.8.9 mod which steals the access token and more things from the targetted user and sends to a backend server for processing. Disclaimer: For educational purposes only.

Minecraft 1.8.9 mod which steals the access token and more things from the targetted user and sends to a backend server for processing. Disclaimer: For educational purposes only.

R.A.T Retrieve Access Token Check DxxxxY/TokenAuth to login into an MC account with a name, token and uuid combo. Features Grabs the username, uuid, t

Jan 9, 2023

A Node.js module for processing .aff files.

affutil.js 一个照抄 feightwywx/arcfutil aff模块 的 Node.js模块 in Typescript 可以进行aff格式字符串与Javascript对象之间的相互转换 为Note对象提供了有限的方法 恐狼是神,快去用arcfutil 用法 导入: In Node.j

Jun 9, 2022

Provides a KafkaJS-compatible handler for processing messages that facilitates publishing to delayed-retry or dead-letter topics

kafkajs-async-retry This module handles retries and dead-lettering for messages from a Kafka topic without blocking the processing of subsequent messa

Dec 5, 2022

A set of scripts to test markdown processing speeds in various site generators/frameworks

bench-framework-markdown A set of scripts to test markdown processing speeds in various site generators/frameworks. Read the blog post: Which Generato

Nov 3, 2022
Owner
null
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
Javascript client for Sanity. Works in node.js and modern browsers (older browsers needs a Promise polyfill).

@sanity/client Javascript client for Sanity. Works in node.js and modern browsers (older browsers needs a Promise polyfill). Requirements Sanity Clien

Sanity 23 Nov 29, 2022
A vscode extension to quickly print variable, variable type, tensor shape etc by using shortcuts

Quick Python Print This repo is inspired by "Python Quick Print". "Python Quick Print" can quickly print out variables on the console by using shortcu

weida wang 5 Oct 28, 2022
Fast Differentiable Tensor Library in JavaScript and TypeScript with Bun + Flashlight

A fast differentiable tensor library for research in TypeScript and JavaScript. Built with bun + flashlight. ⚠️ This is experimental software! ⚠️ Usag

Meta Research 917 Jan 7, 2023
This package generates a unique ID/String for different browsers. Like chrome, Firefox and any other browsers which supports canvas and audio Fingerprinting.

Broprint.js The world's easiest, smallest and powerful visitor identifier for browsers. This package generates a unique ID/String for different browse

Rajesh Royal 68 Dec 25, 2022
All five assignments and the final group project is done in class CSCI5410 (Serverless Data Processing) Fall 2021 of MACS at Dalhousie University.

Dalhousie University | Fall 2021 | CSCI5410 | SDP (Serverless Data Processing) All five assignments and the final group project is done in class CSCI5

Dhrumil Shah 1 Dec 26, 2021
FormGear is a framework engine for dynamic form creation and complex form processing and validation for data collection.

FormGear is a framework engine for dynamic form creation and complex form processing and validation for data collection. It is designed to work across

Ignatius Aditya Setyadi 91 Dec 27, 2022
Typesafe API for processing iterable data in TypeScript and JavaScript.

Stream API Type-safe API for processing iterable data in TypeScript and JavaScript similarly to Java 8 Stream API, LINQ or Kotlin Sequences. Unlike Rx

Norbert Szilagyi 31 Aug 4, 2022
A slick loader to use during your AJAX calls or data processing

Slick Loader A slick loader to use during your AJAX calls or data processing Doc Installation Simply import slick-loader into your HTML. <link rel="st

Zenoo 1 Jan 21, 2022