pandas-tspandas-ts
npm

Install the package#

Terminal
npm install pandas-ts
Terminal
pnpm add pandas-ts
Terminal
yarn add pandas-ts

pandas-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:

PlatformArchitecturesNode.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();    // => 2

Named 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