Skip to content

[Autoloop] [Autoloop: build-tsb-pandas-typescript-migration] Iteration 135#80

Closed
github-actions[bot] wants to merge 2 commits intomainfrom
autoloop/build-tsb-pandas-typescript-migration-iter135-7a7270fbbdba186f
Closed

[Autoloop] [Autoloop: build-tsb-pandas-typescript-migration] Iteration 135#80
github-actions[bot] wants to merge 2 commits intomainfrom
autoloop/build-tsb-pandas-typescript-migration-iter135-7a7270fbbdba186f

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented Apr 9, 2026

🤖 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)
Current best: 89 (iteration 135)
Branch: autoloop/build-tsb-pandas-typescript-migration

Iteration 135 Summary

Added src/core/insert_pop.ts — four non-mutating column manipulation utilities mirroring pandas.DataFrame.insert() and pandas.DataFrame.pop():

  • insertColumn(df, loc, col, values) — inserts a new column at integer position loc. Rebuilds the ordered Map at the right position. Raises RangeError on duplicate column names (unless allowDuplicates=true), out-of-range loc, or mismatched value length. Values can be an array or a Series<Scalar>.
  • popColumn(df, col) — removes a column, returning { series, df } — the extracted Series and the resulting DataFrame (immutable style, never mutates).
  • reorderColumns(df, order) — reorders or subsets columns to match order (mirrors df[order] in pandas).
  • moveColumn(df, col, newLoc) — convenience wrapper combining pop + re-insert at a new position.

Tests

  • 40+ unit tests covering all functions, error cases, and edge cases
  • 3 property-based tests (fast-check): insert+pop round-trips shape, column appears at correct position, popped values match original

Playground

Interactive tutorial: playground/insert_pop.html

Metric: 88 → 89 (+1)


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

References: Run §24165728899

Generated by Autoloop · ● 9.8M ·

…n and removal

Add `src/core/insert_pop.ts` implementing four column manipulation utilities
that mirror pandas' DataFrame.insert() and DataFrame.pop():

- `insertColumn(df, loc, col, values)` — inserts a new column at integer position
  `loc`, rebuilding the ordered column Map; raises RangeError on duplicate names
  (unless allowDuplicates=true), out-of-range loc, or wrong value length
- `popColumn(df, col)` — removes and returns `{ series, df }` (immutable style)
- `reorderColumns(df, order)` — reorders/subsets columns (mirrors df[order])
- `moveColumn(df, col, newLoc)` — convenience wrapper: pop then re-insert

All operations are non-mutating (return new DataFrames). 40+ unit + 3
property-based tests. Interactive playground page: insert_pop.html.

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

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

mrjf commented Apr 12, 2026

@copilot resolve the merge conflicts in this pull request

@mrjf mrjf marked this pull request as ready for review April 12, 2026 13:29
…ndas-typescript-migration-iter135-7a7270fbbdba186f

# Conflicts:
#	playground/index.html
#	src/core/index.ts
#	src/index.ts

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

Copilot AI commented Apr 12, 2026

@copilot resolve the merge conflicts in this pull request

Merge conflicts resolved in commit 7bef281. The three conflicting files (src/core/index.ts, src/index.ts, playground/index.html) were updated to include both Iteration 135's insert_pop additions and the new exports/cards added to main since the PR was opened.

@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.

2 participants