Ciaren

String transform

String transform — stringTransform

Apply a string operation to a column.

Use cases

  • Normalize casing (lower/upper/title/capitalize) and trim whitespace (strip).
  • Replace a substring, measure length (len), or zero-pad codes (pad).

What it does

Applies the chosen operation to every value in the target column in place. Chain multiple String transform nodes (one per operation) for multi-step cleaning.

Before
2 rows · 2 cols
String transform: lower(email), then strip(name)
After
2 rows · 2 cols

Configuration

Config keyTypeRequiredDescription
columnstringYesColumn to transform
operationstringYeslower, upper, strip, title, capitalize, len, replace, pad
findstringConditionalRequired for replace
replace_withstringNoReplacement for replace (default empty)
widthintConditionalTarget width, required for pad
fill_charstringNoPad character (default space)
sidestringNoleft (default) or right for pad

Generated Python code

df_2 = df_1.assign(region=lambda _d: _d['region'].astype('string').str.strip())

Tips & common mistakes

  • capitalize vs title: capitalize upper-cases only the first character of the whole string; title upper-cases the first letter of every word.
  • replace needs find; pad needs width — the form blocks saving otherwise.
  • len produces an integer column (character counts), not text.

See also