tsb

A TypeScript port of pandas, built from first principles

๐Ÿ—๏ธ Active Development โ€” Core Structures Complete

pandas for TypeScript

tsb is a ground-up TypeScript implementation of the pandas data manipulation library, with full API parity, strict types, and an interactive playground for every feature.

๐Ÿ“š Real-World Examples

๐Ÿ“š End-to-end pandas-style scenarios

Sixteen complete, real-world workflows running interactively in the browser โ€” sales dashboards, stock returns, A/B tests, web analytics, revenue waterfalls, SLA control towers, and more.

โœ… New โ€” start here

Feature Roadmap

๐Ÿ“ Project Foundation

Bun, TypeScript (strict), Biome linting, CI, Pages deployment, type system.

โœ… Complete

๐Ÿ“Š Series

1-D labeled array. The core building block of tsb data structures.

โœ… Complete

๐Ÿ—ƒ๏ธ DataFrame

2-D labeled table. Column-oriented storage, full pandas API.

โœ… Complete

๐Ÿท๏ธ Index

Immutable labeled axis, RangeIndex.

โœ… Complete

๐Ÿ”ข Dtypes

Rich dtype system. int/float/bool/string/datetime/category.

โœ… Complete

๐Ÿ”€ GroupBy

Split-apply-combine. groupby, agg, transform, apply, filter.

โœ… Complete

๐Ÿ”— concat

Combine Series and DataFrames. axis=0/1, outer/inner join, ignoreIndex.

โœ… Complete

๐Ÿ”€ merge

SQL-style DataFrame joins. inner/left/right/outer, on/left_on/right_on, suffixes.

โœ… Complete

๐Ÿ”ก str accessor

Vectorised string operations. lower/upper/strip/pad/contains/replace/split/extract & predicates.

โœ… Complete

๐Ÿ“… dt accessor

Vectorised datetime operations. Calendar components, boolean boundaries, strftime, floor/ceil/round.

โœ… Complete

๐Ÿ“Š describe

Summary statistics. count/mean/std/min/percentiles/max for numeric; count/unique/top/freq for categorical. Series.quantile().

โœ… Complete

๐Ÿ“ฅ I/O

CSV I/O. readCsv / toCsv with dtype inference, NA handling, quoted fields, custom separators.

โœ… Complete

๐Ÿ“ฅ JSON I/O

JSON I/O. readJson / toJson with five orient formats: records, split, index, columns, values.

โœ… Complete

๐Ÿ“ˆ corr & cov

Pearson correlation & covariance. Series.corr(), DataFrame.corr(), DataFrame.cov(), dataFrameCorr(), dataFrameCov() with index alignment, null handling, and configurable ddof/minPeriods.

โœ… Complete

๐ŸชŸ rolling

Sliding-window aggregations. Series.rolling() and DataFrame.rolling() with mean, sum, std, var, min, max, count, median, apply. Supports minPeriods and centered windows.

โœ… Complete

๐Ÿ“ˆ expanding

Growing-window aggregations. Series.expanding() and DataFrame.expanding() with mean, sum, std, var, min, max, count, median, apply. Window grows from start to current position.

โœ… Complete

๐Ÿท๏ธ cat accessor

Categorical operations. Series.cat with categories, codes, ordered, addCategories, removeCategories, renameCategories, setCategories, reorderCategories, valueCounts.

โœ… Complete

๐Ÿ“‰ ewm

Exponentially Weighted Moving aggregations. Series.ewm() and DataFrame.ewm() with mean, std, var, cov, corr, apply. Decay via span, com, halflife, or alpha. Supports adjust and ignoreNa.

โœ… Complete

๐Ÿ”€ melt

Wide-to-long reshape. Unpivot columns into variable/value pairs with id_vars, value_vars, var_name, value_name.

โœ… Complete

โ†• lreshape

Wide-to-long reshape with named column groups. Stack multiple wide columns into long columns with explicit grouping, dropna support.

โœ… Complete

๐Ÿ”„ pivot & pivotTable

Reshape with aggregation. pivot() for unique reshaping; pivotTable() for aggregation (mean/sum/count/min/max/first/last) with fill_value and dropna support.

โœ… Complete

๐Ÿ“ stack & unstack

Pivot column labels to/from row index. stack() rotates columns into a compound-index Series; unstack() recovers the DataFrame. Custom sep, dropna, and fill_value support.

โœ… Complete

๐Ÿ† rank

Assign numerical ranks to values. rankSeries() and rankDataFrame() with tie methods (average/min/max/first/dense), NaN handling (keep/top/bottom), percentage ranks, and axis support.

โœ… Complete

๐Ÿ” nlargest / nsmallest

Return the n largest or smallest values. nlargestSeries(), nsmallestSeries(), nlargestDataFrame(), nsmallestDataFrame() with keep='first'/'last'/'all' tie-handling, NaN exclusion, and multi-column DataFrame sorting.

โœ… Complete

๐Ÿ“ˆ cumulative operations

Compute running totals, products, maxima, and minima. cumsum(), cumprod(), cummax(), cummin() for Series and DataFrame with skipna support and axis=0/1.

โœ… Complete

โœ‚๏ธ element-wise ops

Element-wise transformations. clip(), seriesAbs(), seriesRound() for Series and DataFrame with min/max bounds, decimal precision, and axis support.

โœ… Complete

๐Ÿ”ข value_counts

Count unique values. valueCounts() for Series and dataFrameValueCounts() for DataFrame with normalize, sort, ascending, and dropna options.

โœ… Complete

๐Ÿ—‚๏ธ MultiIndex

Hierarchical indexing. MultiIndex for multi-level row and column labels with fromArrays, fromTuples, fromProduct, level access, and swapLevels.

โœ… Complete

๐Ÿ“ฅ insertColumn / popColumn

Insert and remove DataFrame columns at precise positions. insertColumn(df, loc, col, values) inserts at integer position, popColumn(df, col) returns { series, df }. Also includes reorderColumns and moveColumn. Mirrors pandas.DataFrame.insert() and .pop().

โœ… Complete

โœ‚๏ธ cut / qcut

Bin continuous numeric data into discrete intervals. cut() uses fixed-width or explicit bin edges; qcut() uses quantile-based bins of equal population. Both return codes, labels, and bin edges. Mirrors pandas.cut and pandas.qcut.

โœ… Complete

๐Ÿ“Š Rolling Extended Stats

Higher-order rolling window statistics: rollingSem (standard error of mean), rollingSkew (Fisher-Pearson skewness), rollingKurt (excess kurtosis), and rollingQuantile (arbitrary percentile with 5 interpolation methods). Mirrors pandas.Series.rolling().sem/skew/kurt/quantile().

โœ… Complete

๐Ÿ”ง Rolling Apply & Multi-Agg

Standalone custom rolling-window functions: rollingApply (custom fn per window), rollingAgg (multiple named aggregations โ†’ DataFrame), dataFrameRollingApply, dataFrameRollingAgg. Supports minPeriods, center, and raw mode. Mirrors pandas.Rolling.apply() and Rolling.agg().

โœ… Complete

๐ŸชŸ Window Indexers

Custom window indexers for rolling computations: BaseIndexer (abstract base), FixedForwardWindowIndexer (forward-looking N-row window), VariableOffsetWindowIndexer (per-row variable depth), and applyIndexer() helper. Mirrors pandas.api.indexers.

โœ… Complete

๐Ÿ—บ๏ธ Series.map()

Map Series values using a function, Record/dict, another Series (index-label lookup), or ES6 Map. Missing keys produce null. Optional naAction: "ignore" passes NA values through unchanged. Mirrors pandas.Series.map().

โœ… Complete

โš™๏ธ pd.options system

getOption ยท setOption ยท resetOption ยท describeOption ยท optionContext ยท options proxy. Full validator support and 20+ built-in options across display.*, mode.*, compute.* namespaces. Mirrors pandas.get_option / pandas.set_option.

โœ… Complete

๐ŸŽญ where / mask

Element-wise conditional selection: seriesWhere / seriesMask and dataFrameWhere / dataFrameMask. Accepts boolean arrays, label-aligned boolean Series/DataFrame, or callables. Mirrors pandas.Series.where, pandas.DataFrame.where, and their .mask() inverses.

โœ… Complete

๐Ÿ”Ž query / eval

Filter rows or evaluate expressions using a pandas-style expression string. queryDataFrame(df, "col > 5 and label in ['a', 'b']") and evalDataFrame(df, "price * qty"). Supports arithmetic, comparisons, logical operators, membership tests, backtick-quoted column names, and built-in functions (abs, round, isnull, lower, โ€ฆ). Mirrors pandas.DataFrame.query and pandas.DataFrame.eval.

โœ… Complete

๐Ÿ” isna / notna

Module-level missing-value detection: isna, notna, isnull, notnull work on scalars, arrays, Series, and DataFrames. Plus standalone fillna, dropna, countna, and countValid. Mirrors pandas.isna, pandas.notna, pandas.isnull, pandas.notnull.

โœ… Complete

๐Ÿท๏ธ attrs โ€” User Metadata

Attach arbitrary keyโ†’value metadata to any Series or DataFrame via a WeakMap registry. Provides getAttrs, setAttrs, updateAttrs, copyAttrs, withAttrs, mergeAttrs, clearAttrs, getAttr, setAttr, deleteAttr, attrsCount, attrsKeys. Mirrors pandas.DataFrame.attrs / pandas.Series.attrs.

โœ… Complete

๐Ÿšฉ flags โ€” Metadata Flags

Metadata flags for DataFrame and Series. The flags getter returns a Flags object with allowsDuplicateLabels property. Setting allowsDuplicateLabels = false on an object with duplicate index labels raises DuplicateLabelError. Mirrors pandas.DataFrame.flags / pandas.core.flags.Flags.

โœ… Complete

๐Ÿ”ค string_ops โ€” Standalone String Ops

Module-level string utilities: strNormalize (Unicode NFC/NFD/NFKC/NFKD), strGetDummies (one-hot DataFrame), strExtractAll (all regex matches), strRemovePrefix, strRemoveSuffix, strTranslate (char-level substitution), strCharWidth (CJK-aware display width), strByteLength. Works on Series, arrays, or scalars.

โœ… Complete

๐Ÿ”ค string_ops_extended โ€” Extended String Ops

Advanced string utilities: strSplitExpand (split โ†’ DataFrame columns), strExtractGroups (regex capture groups โ†’ DataFrame), strPartition / strRPartition (split into before/sep/after), strMultiReplace (batch replacements), strIndent / strDedent (line-level indentation). Works on Series, arrays, or scalars.

โœ… Complete

๐Ÿ”— pipe_apply โ€” Pipeline & Apply Utilities

Standalone equivalents of pandas' pipe() / apply() / applymap(): pipe (variadic type-safe pipeline), seriesApply (element-wise with label/pos context), seriesTransform, dataFrameApply (axis 0/1), dataFrameApplyMap (cell-wise), dataFrameTransform (column-wise), dataFrameTransformRows (row-wise).

โœ… Complete

๐Ÿ”ข numeric_extended โ€” Numeric Utilities

numpy/scipy-style numeric utilities: digitize (bin values), histogram (frequency counts with density option), linspace / arange (number sequences), percentileOfScore (percentile rank of a score), zscore (z-score standardisation), minMaxNormalize (scale to [0,1] or custom range), coefficientOfVariation (std/mean). Series-aware variants included.

โœ… Complete

๐Ÿท๏ธ categorical_ops โ€” Categorical Utilities

Standalone categorical helpers: catFromCodes (from integer codes), set operations (catUnionCategories, catIntersectCategories, catDiffCategories, catEqualCategories), catSortByFreq, catToOrdinal, catFreqTable, catCrossTab, catRecode.

โœ… Complete

๐Ÿ”ข format_ops โ€” Number Formatting

Number-formatting helpers for Series and DataFrame. Scalar formatters: formatFloat, formatPercent, formatScientific, formatEngineering, formatThousands, formatCurrency, formatCompact. Formatter factories: makeFloatFormatter, makePercentFormatter, makeCurrencyFormatter. Apply to collections: applySeriesFormatter, applyDataFrameFormatter. Render to string: seriesToString, dataFrameToString.

โœ… Complete

๐Ÿ“— Excel I/O

XLSX file reading. readExcel() parses Excel files from a Uint8Array/ArrayBuffer โ€” ZIP+XML parsing from scratch, shared strings, number/string/boolean cells, sheet selection, header, indexCol, skipRows, nrows.

โœ… Complete

๐Ÿ” missing-value ops

Detect and fill missing values. isna(), notna(), isnull(), notnull() for scalars/Series/DataFrame. ffillSeries(), bfillSeries(), dataFrameFfill(), dataFrameBfill() with optional limit and axis support.

โœ… Complete

๐Ÿ“ˆ diff / shift

Discrete difference and value shifting for Series and DataFrame. diff computes element-wise differences; shift lags or leads values by a number of periods. Essential for time-series analysis.

โœ… Complete

๐Ÿ”ข NaN-Ignoring Aggregates

Top-level nan-ignoring aggregate functions: nansum, nanmean, nanmedian, nanstd, nanvar, nanmin, nanmax, nanprod, nancount. Mirrors numpy.nan* functions. Works on arrays and Series.

โœ… Complete

โฑ๏ธ toTimedelta

Convert scalars, arrays, or Series to Timedelta objects. Accepts pandas-style strings, ISO 8601, human-readable, and numeric values. Timedelta class with arithmetic: add/subtract/scale/abs/lt/gt/eq.

โœ… Complete

โณ timedelta_range

Generate fixed-frequency TimedeltaIndex sequences. Supports start/end/periods/freq combinations, multiplier prefixes (e.g. "2H", "30min"), linear spacing, and closed endpoint control.

โœ… Complete

๐Ÿ” strFindall & toJsonDenormalize

strFindall/strFindallCount/strFindFirst/strFindallExpand โ€” regex match extraction per element (mirrors pandas str.findall). toJsonDenormalize/toJsonRecords/toJsonSplit/toJsonIndex โ€” serialize DataFrames to nested or flat JSON.

โœ… Complete

๐Ÿ“Š cutBinsToFrame

Convert cut/qcut BinResult into a tidy summary DataFrame. cutBinsToFrame returns bin labels, edges, counts, and frequencies. cutBinCounts returns a labelโ†’count dict. binEdges returns an edges-only DataFrame.

โœ… Complete

โœ‚๏ธ xs โ€” Cross-Section

xsDataFrame / xsSeries โ€” select rows or columns by label (mirrors pandas .xs()). Supports flat and MultiIndex, axis selection, level targeting, and dropLevel control.

โœ… Complete

โ†”๏ธ between โ€” Range Check

seriesBetween โ€” element-wise range check returning a boolean Series. Mirrors pandas Series.between(). Supports inclusive="both"|"left"|"right"|"neither".

โœ… Complete

๐Ÿ”„ update โ€” In-place Update

seriesUpdate / dataFrameUpdate โ€” update values from another object using label alignment. Non-NA values in other overwrite self. Mirrors pandas DataFrame.update().

โœ… Complete

๐Ÿ”ฝ filter โ€” Filter Labels

filterDataFrame / filterSeries โ€” filter rows or columns by label using items list, substring (like), or regex pattern. Mirrors pandas DataFrame.filter().

โœ… Complete

๐Ÿ”€ combine โ€” Element-wise Combination

combineSeries / combineDataFrame โ€” combine two objects element-wise with a caller-supplied binary function. Result index is the union of both indices. Mirrors pandas Series.combine() / DataFrame.combine().

โœ… Complete

โœ… keepTrue / keepFalse / filterBy โ€” Boolean Indexing

keepTrue / keepFalse / filterBy โ€” boolean-mask selection helpers for Series and DataFrames. Mirrors pandas boolean indexing (series[mask], df[mask]).

โœ… Complete

๐Ÿ”ข scalar_extract โ€” squeeze / item / bool / first_valid_index

squeezeSeries / squeezeDataFrame / itemSeries / boolSeries / boolDataFrame / firstValidIndex / lastValidIndex โ€” scalar-extraction helpers for Series and DataFrames. Mirrors pandas Series.squeeze(), item(), bool(), first_valid_index(), last_valid_index().

โœ… Complete

๐Ÿ“Š corrWith / autoCorr โ€” Pairwise Correlation & Autocorrelation

corrWith / autoCorr โ€” compute pairwise Pearson correlations between a DataFrame and a Series or DataFrame, and compute lag-N autocorrelation for a Series. Mirrors pandas DataFrame.corrwith() and Series.autocorr().

โœ… Complete

๐Ÿ”— join / joinAll / crossJoin โ€” Label-Based Joins

join / joinAll / crossJoin โ€” join DataFrames by index labels or a key column. join() defaults to left-join-on-index, joinAll() chains multiple joins, crossJoin() produces the Cartesian product. Mirrors pandas DataFrame.join().

โœ… Complete

โฑ๏ธ merge_asof โ€” Ordered Nearest-Key Join

mergeAsof โ€” ordered left-join on the nearest key (backward/forward/nearest). Ideal for time-series: match trades to most recent quotes. Supports by-group matching, tolerance, allow_exact_matches, and custom suffixes. Mirrors pandas.merge_asof().

โœ… Complete

๐Ÿ“‹ merge_ordered โ€” Ordered Fill Merge

mergeOrdered โ€” ordered outer/inner/left/right merge sorted by key column(s). Supports fill_method: "ffill" to forward-fill null gaps, left_by/right_by for group-wise ordered merging, left_on/right_on for different key names, and suffix handling. Mirrors pandas.merge_ordered().

โœ… Complete

๐Ÿ“… resample โ€” Time-Based Resampling

resampleSeries / resampleDataFrame โ€” time-based groupby aggregation. Supports S/T/H/D/W/MS/ME/QS/QE/YS/YE frequencies, aggregations (sum, mean, min, max, count, first, last, std, var, size, ohlc), per-column agg specs, and automatic empty-bin filling. Mirrors pandas.DataFrame.resample().

โœ… Complete

๐Ÿ” infer_objects / convert_dtypes โ€” Dtype Inference

inferObjectsSeries / inferObjectsDataFrame / convertDtypesSeries / convertDtypesDataFrame โ€” promote object-typed Series to better dtypes and parse string columns as numbers. Mirrors pandas infer_objects() and convert_dtypes().

โœ… Complete

๐Ÿงช testing โ€” Assertion Utilities

assertSeriesEqual / assertFrameEqual / assertIndexEqual โ€” rich assertion helpers for use in test suites. Numeric tolerance, checkLike column-order mode, dtype checks, AssertionError with detailed diff messages. Mirrors pandas.testing.

โœ… Complete

๐ŸŽจ Styler โ€” DataFrame Style API

dataFrameStyle(df) ยท highlightMax / highlightMin / highlightNull / highlightBetween ยท backgroundGradient / textGradient ยท barChart ยท format / formatIndex ยท apply / applymap / map ยท setCaption / setTableStyles / hide ยท toHtml / toLatex. Mirrors pandas.DataFrame.style (Styler).

โœ… Complete

๐Ÿ”‘ hashPandasObject โ€” FNV-1a Hashing

hashPandasObject(s) ยท hashPandasObject(df) ยท index option. Mirrors pandas.util.hash_pandas_object. FNV-1a 64-bit per element or row.

โœ… Complete

๐Ÿ—ƒ๏ธ pdArray โ€” pd.array() Factory

pdArray(data, dtype?) โ€” create typed arrays from any iterable. Dtype inference for int64/float64/bool/string/datetime. Mirrors pandas.array().

โœ… Complete

๐Ÿ“‹ Table Formatters โ€” to_markdown / to_latex

toMarkdown() and toLaTeX() โ€” render DataFrames and Series as Markdown tables or LaTeX tabular environments. Mirrors pandas.DataFrame.to_markdown() and to_latex().

โœ… Complete

๐ŸŒ readHtml โ€” pd.read_html()

readHtml(html, opts?) โ€” parse HTML tables into DataFrames. Header detection, NA handling, numeric coercion, thousands/decimal separators, indexCol, match filter. Mirrors pandas.read_html().

โœ… Complete

๐Ÿ“„ readXml / toXml โ€” pd.read_xml() / DataFrame.to_xml()

readXml(text, opts?) / toXml(df, opts?) โ€” parse XML into DataFrames and serialize back. rowTag auto-detection, attributes, CDATA, entities, namespaces, usecols, nrows, indexCol. Mirrors pandas.read_xml() / DataFrame.to_xml().

โœ… Complete

๐Ÿ“‹ readTable โ€” pd.read_table()

readTable(text, opts?) โ€” parse delimiter-separated text into a DataFrame. Defaults to tab separator; all ReadCsvOptions forwarded. Mirrors pandas.read_table().

โœ… Complete

๐Ÿ—„๏ธ SQL I/O โ€” pd.read_sql() / DataFrame.to_sql()

readSql / readSqlQuery / readSqlTable / toSql โ€” adapter-based SQL I/O. Bring your own DB driver; zero runtime dependencies. Mirrors pandas.read_sql(), read_sql_query(), read_sql_table(), DataFrame.to_sql().

โœ… Complete

๐Ÿ“Š readStata & toStata โ€” pd.read_stata() / DataFrame.to_stata()

readStata / toStata โ€” Stata DTA binary file I/O. Supports reading v114/115 (old binary) and v117/118/119 (new XML-tagged) formats; writes v118. Missing values, string columns, value labels (convertCategoricals). Mirrors pandas.read_stata(), DataFrame.to_stata().

โœ… Complete

๐Ÿ“ฆ readParquet & toParquet โ€” pd.read_parquet() / DataFrame.to_parquet()

readParquet / toParquet โ€” Apache Parquet binary file I/O. Pure-TypeScript Thrift compact protocol, PLAIN encoding, INT32/INT64/DOUBLE/BOOLEAN/BYTE_ARRAY types, optional columns, usecols/nRows/indexCol/writeIndex. Mirrors pandas.read_parquet(), DataFrame.to_parquet().

โœ… Complete

๐Ÿ“ readFwf โ€” pd.read_fwf()

readFwf(text, opts?) โ€” read fixed-width formatted text into a DataFrame. Auto-infers column boundaries from whitespace patterns; supports explicit colspecs / widths, header, names, indexCol, NA handling, dtype forcing, skipRows, nRows. Mirrors pandas.read_fwf().

โœ… Complete

๐Ÿ”€ case_when โ€” pd.Series.case_when()

caseWhen(series, caselist) โ€” conditional value selection using ordered CASE WHEN semantics. Mirrors pandas.Series.case_when() (pandas 2.2+).

โœ… Complete

๐Ÿ—‚๏ธ readHdf & toHdf โ€” pd.read_hdf() / DataFrame.to_hdf()

readHdf / toHdf โ€” HDF5 v0 Superblock binary file I/O. Pure-TypeScript, no native deps. Float64/32, Int/UInt 8โ€“64, Bool, fixed-length UTF-8 strings. usecols, indexCol, writeIndex, custom key. Mirrors pandas.read_hdf(), DataFrame.to_hdf().

โœ… Complete

๐Ÿ”ข pd.arrays โ€” Nullable Typed Extension Arrays

Nullable typed arrays: IntegerArray, FloatingArray, BooleanArray, StringArray, DatetimeArray, TimedeltaArray. Three-valued logic, NA masking, element-wise arithmetic, string ops. Mirrors pandas.arrays.

โœ… Complete

๐Ÿ—“๏ธ Holiday Calendars โ€” pd.tseries.holiday

Holiday calendar system: Holiday rules (fixed & floating), AbstractHolidayCalendar, USFederalHolidayCalendar (11 US federal holidays), observance helpers (nearestWorkday, sundayToMonday, โ€ฆ), and weekday offsets (MO, TH, โ€ฆ). Mirrors pandas.tseries.holiday.

โœ… Complete

๐Ÿ•ณ๏ธ SparseArray & SparseDtype โ€” pd.arrays.SparseArray

Memory-efficient sparse storage for arrays with many repeated (fill) values. SparseArray stores only non-fill values and their positions. Properties: sp_values, sp_index, density, npoints. Aggregations: sum, mean, max, min, std. Mirrors pandas.arrays.SparseArray and pandas.SparseDtype.

โœ… Complete

๐Ÿ”ฌ Hypothesis Tests โ€” scipy.stats t-tests, chiยฒ, ANOVA, KS

scipy-style statistical hypothesis tests implemented from scratch: ttest1samp, ttestInd (Welch's), ttestRel (paired), chi2Contingency, fOneway (ANOVA), jarqueBera (normality), pearsonr, spearmanr, mannWhitneyU, kstest. Returns { statistic, pvalue }.

โœ… Complete

๐Ÿ“ Regression โ€” linregress, polyfit, OLS

Linear and polynomial regression from scratch: linregress (simple OLS with slope, r, p, stderr), polyfit / polyval (polynomial least squares), and OLS class (multiple regression with Rยฒ, F-test, AIC, BIC, predict(), summary()). Mirrors scipy.stats.linregress, numpy.polyfit, and statsmodels.OLS.

โœ… Complete

๐Ÿ“Š Contingency Tables โ€” expectedFreq, relativeRisk, oddsRatio, association

Association and effect-size measures for contingency tables: expectedFreq (expected cell counts under independence), relativeRisk (risk ratio with log-normal CI), oddsRatio (Woolf CI), and association (Cramรฉr's V, phi, Pearson's C, Tschuprow's T). Mirrors scipy.stats.contingency.

โœ… Complete

๐Ÿ”ญ Multivariate Analysis โ€” mahalanobis, PCA

Multivariate statistical analysis: mahalanobis distance (ฮฃโปยน-weighted Euclidean, mirrors scipy.spatial.distance.mahalanobis), PCA class (eigendecomposition of the covariance matrix, mirrors sklearn.decomposition.PCA), plus covMatrix and invertMatrix helpers.

โœ… Complete

๐ŸŽฒ Bootstrap โ€” non-parametric confidence intervals

Non-parametric bootstrap confidence intervals for any statistic: bootstrap (one or two samples, mirrors scipy.stats.bootstrap), bootstrap1 (single-sample convenience). Methods: percentile, basic (pivoting), and BCa (bias-corrected accelerated, default). Seeded RNG for reproducibility.

โœ… Complete

๐Ÿ“Š Kernel Density Estimation (KDE)

Non-parametric density estimation using Gaussian kernels: gaussianKDE (mirrors scipy.stats.gaussian_kde). Bandwidth methods: Silverman (default), Scott, or custom factor. API: pdf, evaluate, logPdf, integrate, cdf, resample, integrateGaussian, weighted KDE.

โœ… Complete

โ„น๏ธ Information Theory

Shannon entropy, KL divergence, Jensen-Shannon divergence/distance, cross-entropy, mutual information, conditional entropy, normalised MI, variation of information, joint entropy, Rรฉnyi entropy, and Tsallis entropy. Mirrors scipy.stats.entropy and related utilities.

โœ… Complete

๐Ÿ“ก Signal Processing โ€” FFT, STFT, Welch PSD

FFT/IFFT/RFFT (Cooley-Tukey radix-2), fftFreq, fftshift/ifftshift, 8 window functions (getWindow), Short-Time Fourier Transform (stft/istft with overlap-add), Welch power spectral density, and periodogram. Mirrors numpy.fft and scipy.signal.

โœ… Complete

๐ŸŽ›๏ธ Digital Filters โ€” FIR, Butterworth IIR

FIR filter design via windowed-sinc (firwin), Butterworth IIR (butter), frequency response (freqz, sosfreqz), and filter application: lfilter (causal), filtfilt (zero-phase), sosfilt, sosfiltfilt. Mirrors scipy.signal.

โœ… Complete

๐Ÿ—‚๏ธ ORC Format I/O โ€” readOrc / toOrc

Apache ORC (Optimized Row Columnar) file format reader and writer. Supports BOOLEAN, INT/LONG, FLOAT/DOUBLE, STRING columns with NONE compression and RLE v1 / direct encoding. Mirrors pandas.read_orc() and DataFrame.to_orc().

โœ… Complete

๐Ÿ“ˆ ACF / PACF & Portmanteau Tests

autocorr, acf (Bartlett CI), pacf (Levinson-Durbin), ccf, durbinWatson, Ljung-Box and Box-Pierce portmanteau tests. Mirrors statsmodels.tsa.stattools and pd.Series.autocorr.

โœ… Complete

๐Ÿ“‰ ARIMA(p,d,q) Time-Series Models

ARIMAModel and fitArima โ€” Hannan-Rissanen two-step estimation, multi-step forecasting, prediction intervals, AIC/BIC. Mirrors statsmodels.tsa.arima.model.ARIMA.

โœ… Complete

๐Ÿ”ญ Kalman Filter & RTS Smoother

KalmanFilter โ€” linear Gaussian state-space models with forward Kalman filter and backward RTS smoother. Factory helpers localLevel, localLinearTrend. Missing observations handled transparently.

โœ… Complete

๐Ÿ“ฆ Apache Avro OCF I/O โ€” readAvro / toAvro

readAvro and toAvro โ€” Apache Avro Object Container File reader and writer. Supports all Avro primitives, arrays, maps, unions, and records. Zigzag varint encoding. Mirrors pandas.read_avro().

โœ… Complete

๐Ÿ“Š Exponential Smoothing โ€” ETS / Holt-Winters

SimpleExpSmoothing, Holt, and ExponentialSmoothing โ€” SES, Holt linear trend, and full Holt-Winters with additive/multiplicative seasonal components. Nelder-Mead parameter optimisation, AIC/BIC/AICc, prediction intervals. Mirrors statsmodels.tsa.holtwinters.ExponentialSmoothing.

โœ… Complete

๐Ÿ”ฒ Dynamic Linear Model (DLM)

DLM โ€” West & Harrison state-space framework. Local-level, local-linear-trend, polynomial trend, Fourier seasonal components, free combination via combineDLMs. Kalman filter, RTS smoother, h-step forecasting, MLE fitting, discount-factor model. Mirrors the R dlm package.

โœ… Complete

๐Ÿ”ฎ Hidden Markov Model (HMM)

GaussianHMM, MultinomialHMM โ€” Baum-Welch EM parameter estimation, Viterbi decoding, forward-backward log-space algorithm. Regime detection, sequence labeling. Mirrors hmmlearn.

โœ… Complete

โšก Benchmarks

Side-by-side performance comparison of tsb (TypeScript/Bun) vs pandas (Python). Timing metrics for each function.

๐Ÿ—๏ธ In Progress