← 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.
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent
With capture groups
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent
Null / NaN handling
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent
2. strFindallCount — count matches per element
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent
3. strFindFirst — first match per element
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).
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.
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent
Custom separator
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent
Drop null values
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent
toJsonRecords — orient="records"
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent
toJsonSplit — orient="split"
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent
toJsonIndex — orient="index"
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent