Text that people type is messy: extra spaces, random capitals, phone numbers in four formats. pandas cleans whole columns at once through the .str accessor, which gives a column the methods Python strings have.
raw["name"].str.strip().str.title()
str.strip() removes spaces at both ends.
str.lower(), str.upper() and str.title() fix capitals.
str.contains("gold", case=False) returns a mask for filtering; case=False ignores capitals.
str.replace(old, new) swaps text. With regex=True the pattern is a regular expression, so r"\D" means "any character that isn't a digit".
str.split(" ", n=1, expand=True) splits each value into separate columns.
Each step returns a new column, so you chain them, and you assign the result back to keep it: raw["email"] = raw["email"].str.strip().str.lower().
The data here is customers_raw.csv, the customer list as staff typed it in, loaded as raw.