Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Use Series.str.split(delimiter, expand=True) to turn a pandas string column into separate columns. Set n= if you want to limit how many delimiters are used, and set regex=False when a multi-character separator should be treated literally.
Split a column into separate columns
Call the string accessor on the Series and pass expand=True. Replace the comma below with the delimiter in your data:
As an Amazon Associate I earn from qualifying purchases.
parts = df["column"].str.split(",", expand=True)
parts is a DataFrame with one column for each resulting piece. To replace the original column, inspect the output first, then assign meaningful names that match its number of columns:
Recommended Free Tools
parts = df["column"].str.split(",", expand=True)
parts.columns = ["first", "second"]
df[["first", "second"]] = parts
This naming example assumes the split produces exactly two columns; adjust the names to the actual output shape. Without expand=True, str.split returns lists in a Series rather than separate DataFrame columns. If you omit the delimiter, pandas splits on whitespace.
#1 Best Overall
Choose how many delimiters to use
By default, n=-1 means split at every occurrence. Use a positive n to limit the number of splits, starting from the left:
df["column"].str.split(",", n=1, expand=True)
This makes at most one split per value, leaving any later commas in the final piece. n=None and n=0 also mean split at all occurrences.
Rank #2
Make literal and regex separators explicit
With the default regex=None, pandas treats a one-character pattern as a literal separator, but a pattern longer than one character as a regular expression. For a multi-character delimiter that should be matched exactly, set regex=False:
df["column"].str.split("::", regex=False, expand=True)
Use regex=True when the pattern is intentionally a regular expression. In that case, escape regex metacharacters that should be matched literally.
Know what happens with uneven or missing values
Expanded results have a rectangular shape. When some rows split into fewer pieces than others, pandas pads the shorter results with missing values. Missing input values remain missing in the expanded output; they are not converted into empty strings.
Use a different method for only the first or last separator
Split around the first separator
Series.str.partition returns three pieces: the text before the separator, the separator itself, and the text after it. It is useful when you want to preserve the remainder as one piece.
Split from the right
Use Series.str.rsplit(delimiter, n=1, expand=True) to split at most once, working from the end of each value.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchChoose the output shape
- Separate columns: use
str.split(..., expand=True). - Lists in one Series: omit
expand=True. - Rows from list-like values: use
Series.explodeafter splitting; this reshapes the data into long format rather than creating columns.
See the pandas documentation for Series.str.split, the working with text guide, Series.str.partition, Series.str.rsplit, and Series.explode.
Quick Recap
Best Value
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




