numpy-ts offers a comprehensive implementation of NumPy for TypeScript and JavaScript, achieving 94% API coverage with extensive testing. With Type-safe definitions and tree-shakeable modules, it provides a familiar NumPy experience in a modern programming environment, ideal for both Node.js and browser applications.
numpy-ts is a comprehensive implementation of the full NumPy library, designed specifically for TypeScript and JavaScript environments. With 94% API coverage, this project includes 476 of 507 NumPy functions, making it an ideal choice for developers who require NumPy's capabilities in web and server-side applications.
Begin utilizing numpy-ts with simple, concise code snippets:
import * as np from 'numpy-ts';
// Array creation with dtype support
const A = np.array([[1, 2], [3, 4]], 'float32');
const B = np.ones([2, 2], 'int32');
// Broadcasting and chained operations
const result = A.add(5).multiply(2);
// Linear algebra operations
const C = A.matmul(B);
const trace = A.trace();
// Reductions with axis support
const colMeans = A.mean(0); // Returns [2.0, 3.0]
// NumPy-style slicing
const row = A.slice('0', ':'); // Equivalent to A[0, :]
const submatrix = A.slice('0:2', '1:'); // Equivalent to A[0:2, 1:]
To deepen understanding and find more examples, access the following:
Contributions in the form of issues and pull requests are encouraged to enhance this project further.
This will help to elevate TypeScript as a first-class research language. Great work!
Sign in to comment.