[Autoloop] [Autoloop: build-tsb-pandas-typescript-migration] Iteration 135#80
Closed
github-actions[bot] wants to merge 2 commits intomainfrom
Closed
Conversation
…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>
Contributor
|
@copilot resolve the merge conflicts in this pull request |
…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>
Contributor
Merge conflicts resolved in commit |
Contributor
|
Closing — superseded by #120 (the most complete migration PR). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 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-migrationIteration 135 Summary
Added
src/core/insert_pop.ts— four non-mutating column manipulation utilities mirroringpandas.DataFrame.insert()andpandas.DataFrame.pop():insertColumn(df, loc, col, values)— inserts a new column at integer positionloc. Rebuilds the ordered Map at the right position. RaisesRangeErroron duplicate column names (unlessallowDuplicates=true), out-of-rangeloc, or mismatched value length. Values can be an array or aSeries<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 matchorder(mirrorsdf[order]in pandas).moveColumn(df, col, newLoc)— convenience wrapper combining pop + re-insert at a new position.Tests
Playground
Interactive tutorial:
playground/insert_pop.htmlMetric: 88 → 89 (+1)
🤖 This PR is maintained by Autoloop. Each accepted iteration adds a commit to this branch.
References: Run §24165728899