Skip to content

[Autoloop] [Autoloop: build-tsb-pandas-typescript-migration]#119

Closed
github-actions[bot] wants to merge 19 commits intomainfrom
autoloop/build-tsb-pandas-typescript-migration-aad5437aa428df31
Closed

[Autoloop] [Autoloop: build-tsb-pandas-typescript-migration]#119
github-actions[bot] wants to merge 19 commits intomainfrom
autoloop/build-tsb-pandas-typescript-migration-aad5437aa428df31

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

🤖 This PR is maintained by Autoloop. Each accepted iteration adds a commit to this branch.

Program

Goal: Build tsb — a complete TypeScript port of pandas, one feature at a time.
Metric: pandas_features_ported (higher is better)
Steering Issue: #107
Current Best Metric: 50 (iteration 215)

Latest: Iteration 215 — readExcel

Added io/read_excel.ts: dependency-free XLSX reader from scratch.

  • ZIP binary parser (EOCD + central directory + local headers)
  • Raw DEFLATE decompression via node:zlib inflateRawSync
  • XML parsing via regex generators
  • Full DataFrame with dtype inference, header/skipRows/nrows/naValues/indexCol options
  • xlsxSheetNames() for metadata-only access
  • 26 passing tests, playground page

Metric improved: 49 → 50. Commit: 5748b07.

Generated by Autoloop · ● 13.1M ·

github-actions Bot and others added 19 commits April 12, 2026 00:19
Implements pandas missing-value utilities as standalone exported functions:
- `isna` / `notna` / `isnull` / `notnull` — detect missing values in
  scalars, Series, and DataFrames (mirrors pd.isna / pd.notna)
- `ffillSeries` / `bfillSeries` — forward/backward fill for Series with
  optional `limit` parameter
- `dataFrameFfill` / `dataFrameBfill` — column-wise or row-wise fill for
  DataFrames with optional `limit` and `axis` parameters

Metric: 28 → 29 pandas_features_ported

Run: https://github.com/githubnext/tsessebe/actions/runs/24263385922

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Implements pctChangeSeries() and pctChangeDataFrame() mirroring
pandas.Series.pct_change() / pandas.DataFrame.pct_change().

- periods: configurable lag (positive = backward, negative = forward)
- fillMethod: "pad" (default), "bfill", or null (no fill)
- limit: cap consecutive fills
- axis: column-wise (default) or row-wise for DataFrame

Full test coverage: unit tests, edge cases, and fast-check property tests.
Interactive playground page at playground/pct_change.html.

Run: https://github.com/githubnext/tsessebe/actions/runs/24266545401
…g for Series and DataFrame

Run: https://github.com/githubnext/tsessebe/actions/runs/24283807306

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- stats/duplicated.ts: duplicatedSeries, duplicatedDataFrame, dropDuplicatesSeries,
  dropDuplicatesDataFrame with keep='first'/'last'/false and subset support
- core/sample.ts: sampleSeries, sampleDataFrame with n/frac, replace,
  weighted sampling, and seeded RNG (randomState)
- 35 tests each (unit + fast-check properties)
- Playground pages: duplicated.html, sample.html

Run: https://github.com/githubnext/tsessebe/actions/runs/24285279820

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- stats/clip_advanced.ts: clipAdvancedSeries, clipAdvancedDataFrame with per-element
  bounds from scalar, array, Series (positional), or DataFrame (element-wise).
  DataFrame bounds support axis=0/1 for Series broadcasting.
- stats/apply.ts: applySeries, mapSeries (function/dict/Map), applyDataFrame (reduce
  per col/row), applyExpandDataFrame (transform per col/row → DataFrame), mapDataFrame
  (element-wise). Helper decomposition satisfies Biome complexity rules.
- 25+ unit + property-based tests each (fast-check)
- Playground pages: clip_advanced.html, apply.html
- Creates canonical branch autoloop/build-tsb-pandas-typescript-migration from iter 199

Run: https://github.com/githubnext/tsessebe/actions/runs/24287426738

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- stats/cut.ts: cut() for equal-width or user-defined bins, qcut() for quantile bins
- cutCodes() returns integer bin codes; cutCategories() returns label arrays
- CutOptions: right, labels, retbins, precision, includeLowest, ordered
- QcutOptions: labels, retbins, precision, duplicates (raise/drop)
- 30+ unit tests + fast-check property tests
- Playground page: cut.html (8 interactive demos)
- Export from stats/index.ts and src/index.ts

Run: https://github.com/githubnext/tsessebe/actions/runs/24288003426

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…range

Add `stats/interval.ts` with:
- `Interval` class — single bounded interval with all four closed types (left/right/both/neither)
- `IntervalIndex` — ordered array of intervals with fromBreaks, fromArrays, fromIntervals factories
- `intervalRange()` — equal-length interval ranges by period count or step size
- Lookup: indexOf, overlapping, append, isMonotonic
- 60+ unit tests + fast-check property tests
- Playground page interval.html (8 interactive demos)

Run: https://github.com/githubnext/tsessebe/actions/runs/24288493950

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Run: https://github.com/githubnext/tsessebe/actions/runs/24289114918

Add `stats/get_dummies.ts` with:
- `getDummies(data, options?)` — one-hot encode a Series or DataFrame (unified API)
- `getDummiesSeries` — encode a single Series into binary indicator columns
- `getDummiesDataFrame` — encode categorical columns in a DataFrame
- `fromDummies(df, options?)` — reverse one-hot encoding back to a categorical Series
Options: prefix, prefixSep, dummyNa, columns (DataFrame), dropFirst, dtype
45+ unit + fast-check tests. Playground page get_dummies.html (8 interactive demos).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add stats/crosstab.ts with crosstab() and crosstabSeries():
- Frequency count of co-occurrences of two factor arrays/Series
- Custom aggfunc (count/sum/mean/min/max) with values parameter
- margins: adds All row/column with totals
- normalize: all/index/columns proportion tables
- dropna: exclude/include null factor values

21 tests (unit + property-based) all pass. Lint clean.
Metric: 43 (previous best: 42, delta: +1).

Run: https://github.com/githubnext/tsessebe/actions/runs/24290127464

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Implements reshape/pivot_table.ts with full pandas.pivot_table() parity:
- All aggfuncs: mean, sum, min, max, count, first, last
- margins=true adds All row/column using raw data (not cell aggregates)
- margins_name to customize the All label
- sort option (default true) for lexicographic row/column ordering
- fill_value and dropna support
- Multiple index/column columns supported

Tests: 25 unit tests + 4 property-based tests (fast-check)
Playground: playground/pivot_table.html with 8 interactive demos
Metric: 44 (previous best: 43, delta: +1)

Run: https://github.com/githubnext/tsessebe/actions/runs/24290574060

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Implements pandas.DataFrame.explode / Series.explode:
- explodeSeries: expand array-valued cells into individual rows
- explodeDataFrame: explode one or more columns, repeating other columns
- ignore_index option to reset to RangeIndex
- Handles null, empty arrays, scalars, multi-column explosion (zip-longest)
- 27 unit tests + property-based tests (fast-check)
- Playground page with 8 interactive demos

Run: https://github.com/githubnext/tsessebe/actions/runs/24291234244

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add two new pandas features:
- src/stats/factorize.ts: factorize() and factorizeSeries() — integer encoding of
  categorical values. First-seen or sorted order, configurable NA sentinel.
  30 unit tests + 4 property-based tests. Playground: factorize.html.
- src/reshape/wide_to_long.ts: wideToLong() — reshape wide-format DataFrames to
  long format by gathering stub-prefixed columns. Supports multiple stubs,
  custom separator/suffix, multiple id columns. 14 unit tests + 3 property-based
  tests. Playground: wide_to_long.html.

Metric: 47 pandas_features_ported (previous best: 46, delta: +1)

Run: https://github.com/githubnext/tsessebe/actions/runs/24292269871

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Implements pandas Series.interpolate() and DataFrame.interpolate():
- interpolateSeries: linear, pad/ffill, backfill/bfill, nearest methods
- interpolateDataFrame: axis=0 (column-wise) and axis=1 (row-wise)
- limit: max consecutive NaN values to fill
- limitDirection: forward, backward, both
- limitArea: inside (interior gaps only) or outside (edge values only)
- 35 unit tests + 4 property-based tests
- Playground page with 8 interactive demos

Run: https://github.com/githubnext/tsessebe/actions/runs/24292676836

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Port pandas DataFrame.select_dtypes(include, exclude) to TypeScript.
Accepts exact dtype names and generic aliases (number, integer, floating,
bool, string, datetime, timedelta, category, object, signed, unsigned).

Run: https://github.com/githubnext/tsessebe/actions/runs/24293279696

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Implement io/read_excel.ts: a dependency-free XLSX reader built on a
ZIP binary parser (EOCD + central directory + local headers), raw
DEFLATE decompression via node:zlib inflateRawSync, and XML parsing
via regex generators. Returns a full DataFrame with dtype inference,
header/skipRows/nrows/naValues/indexCol options. Also exposes
xlsxSheetNames() for metadata-only access. 26 passing tests, playground
page added.

Metric: 49 → 50 pandas features ported.

Run: https://github.com/githubnext/tsessebe/actions/runs/24294236300

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mrjf
Copy link
Copy Markdown
Contributor

mrjf commented Apr 17, 2026

Closing — superseded by #120 (the most complete migration PR).

@mrjf mrjf closed this Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant