Initializing playground…
← Back to roadmap

str.findall & to_json_normalize

Two new features in tsb: strFindall / strFindallCount / strFindFirst / strFindallExpand (mirrors pandas.Series.str.findall) and toJsonDenormalize / toJsonRecords / toJsonSplit / toJsonIndex (the inverse of jsonNormalize).

1. strFindall — all regex matches per element

Mirrors pandas.Series.str.findall(pat). Returns a Series where each value is a JSON-encoded array of all non-overlapping matches.

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

With capture groups

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

Null / NaN handling

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

2. strFindallCount — count matches per element

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

3. strFindFirst — first match per element

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

4. strFindallExpand — expand capture groups into a DataFrame

Mirrors pandas.Series.str.extract(pat, expand=True).

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

5. toJsonDenormalize — flat DataFrame → nested JSON

The inverse of jsonNormalize: takes a DataFrame with dot-separated column names and reconstructs nested JSON objects.

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

Custom separator

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

Drop null values

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

toJsonRecords — orient="records"

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

toJsonSplit — orient="split"

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

toJsonIndex — orient="index"

TypeScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent