Split column
Split column — splitColumn
Split one text column into several columns, by a literal delimiter or by regex capture groups.
Use cases
- Split a full name into
first/last. - Break a code like
A-100into its parts with a regex.
What it does
Splits the source column on the delimiter (or regex capture groups) and writes
one new column per name in into. Rows with fewer parts leave trailing columns null.
Before
| id | full_name |
|---|---|
| 1 | Ada Lovelace |
| 2 | Grace Hopper |
| 3 | Linus Torvalds |
3 rows · 2 cols
Split column (column=full_name, delimiter=space, into=[first, last])
After
| id | full_name | firstnew | lastnew |
|---|---|---|---|
| 1 | Ada Lovelace | Ada | Lovelace |
| 2 | Grace Hopper | Grace | Hopper |
| 3 | Linus Torvalds | Linus | Torvalds |
3 rows · 4 cols
Configuration
| Config key | Type | Required | Description |
|---|---|---|---|
column | string | Yes | Text column to split |
mode | string | No | delimiter (default) or regex |
delimiter | string | Conditional | Delimiter to split on (required for delimiter mode) |
pattern | string | Conditional | Regex; capture group 1 → first column, etc. (required for regex mode) |
into | string[] | Yes | Names for the resulting columns, in order |
keep_original | bool | No | Keep the source column (default true) |
Generated Python code
_parts = df_1['name'].astype('string').str.split(' ', expand=True)
df_2 = df_1.assign(first=_parts[0], last=_parts[1])
Tips & common mistakes
intonames the outputs in order. In regex mode, capture group 1 fills the first name, group 2 the second, and so on.- Uneven splits leave trailing columns null when a row has fewer parts.
- Set
keep_original: falseto drop the source column after splitting.