Install the package#
Terminal
npm install pandas-tsTerminal
pnpm add pandas-tsTerminal
yarn add pandas-tspandas-ts is a pure TypeScript package. No compiler, CMake or Python required.
Peer dependency: @cyfora/numera#
pandas-ts lists @cyfora/numera as a regular dependency — it is installed automatically. numera ships prebuilt C++ binaries for:
| Platform | Architectures | Node.js |
|---|---|---|
| macOS 13.3+ | arm64 (Apple Silicon), x64 (Intel) | >=18 |
| Linux (glibc ≥ 2.28: Ubuntu 20.04+, Debian 10+) | x64, arm64 | >=18 |
On unsupported platforms numera falls back to a pure-JavaScript implementation automatically.
Importing#
pandas-ts is an ES module. The default export is the pd namespace:
TypeScript
import pd from 'pandas-ts';
const s = new pd.Series([1, 2, 3]);
s.mean(); // => 2Named imports also work:
TypeScript
import { Series, DataFrame, read_csv, concat } from 'pandas-ts';CommonJS is also supported via dynamic import:
JavaScript
const { Series } = await import('pandas-ts');Verify the installation#
TypeScript
import { Series } from 'pandas-ts';
const s = new Series([3, 4]);
console.log(s.norm()); // => 5 (powered by numera's C++ linalg.norm)
console.log(s.mean()); // => 3.5