Skip to content

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

Draft
github-actions[bot] wants to merge 6 commits into
mainfrom
autoloop/build-tsb-pandas-typescript-migration
Draft

[Autoloop: build-tsb-pandas-typescript-migration]#323
github-actions[bot] wants to merge 6 commits into
mainfrom
autoloop/build-tsb-pandas-typescript-migration

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Summary

Iteration 316: Add readXml() and toXml() — port of pandas.read_xml() / DataFrame.to_xml().

What's new

  • src/io/xml.ts — zero-dependency XML I/O module:

    • readXml(text, options?): parses XML into a DataFrame
      • Auto-detects row element tag (most-repeated child of root)
      • Reads both attributes and child element text as columns
      • Namespace prefix stripping (ns:colcol)
      • Entity decoding (&, <, A, A, ...)
      • CDATA sections handled transparently
      • XML comment nodes ignored
      • Options: rowTag, indexCol, usecols, naValues, converters, nrows, attribs, elems
    • toXml(df, options?): serializes DataFrame to well-formed XML
      • Child-element mode (default) or attribute mode (attribs: true)
      • Options: rootName, rowName, attribs, xmlDeclaration, namespaces, indent, cdataCols
      • Entity encoding for special characters; CDATA wrapping for specified columns
  • tests/io/xml.test.ts — 50+ tests: unit, property-based (fast-check), round-trip

  • playground/xml.html — 9 interactive playground examples

  • Updated src/io/index.ts, src/index.ts, playground/index.html

Metric

pandas_features_ported: 148 → 149 (+1)

Program

Related to issue #1.


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

Generated by Autoloop · ● 79.1M ·

…readXml() and toXml() — pd.read_xml() / DataFrame.to_xml() port

Zero-dep XML tokenizer supporting attributes, child elements, CDATA,
entities, namespace prefix stripping, naValues, usecols, nrows, indexCol.
toXml: rootName, rowName, attribs, xmlDeclaration, namespaces, indent,
cdataCols. Entity encoding/decoding, full round-trip support.
50+ tests + property tests. Playground page with 9 interactive examples.

Run: https://github.com/githubnext/tsb/actions/runs/25970646245

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
mrjf and others added 2 commits May 16, 2026 12:49
…readTable() — pd.read_table() port

Add `readTable()` function that mirrors `pandas.read_table()`:
- Thin wrapper around `readCsv` defaulting sep to '\t' (tab)
- Distinct from readCsv (different default separator)
- Full ReadCsvOptions forwarding: indexCol, nRows, skipRows, dtype, naValues
- 40+ unit tests covering all options, edge cases, and property-based round-trips
- Interactive playground page with 9 examples

Run: https://github.com/githubnext/tsb/actions/runs/25992061510

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

Commit pushed: be17c93

Generated by Autoloop

mrjf and others added 2 commits May 17, 2026 06:38
…caseWhen() — pd.Series.case_when() port

Implements pandas.Series.case_when(caselist) (pandas 2.2+) as a standalone
caseWhen() function. Applies an ordered list of (condition, replacement)
pairs — first matching condition wins, unmatched rows keep original value.

- src/stats/case_when.ts: full implementation with ResolvedBranch pre-extraction
- Conditions: boolean Series, boolean array, or predicate (value, idx) => boolean
- Replacements: scalar, Series, or array
- 316 lines of tests (unit + property-based with fast-check)
- 9-example playground page
- Exported from src/stats/index.ts and src/index.ts

Run: https://github.com/githubnext/tsb/actions/runs/26021661493

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

Commit pushed: 074f9f5

Generated by Autoloop

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