Splitting and Extracting Text

str.split with expand=True turns one text column into several, with n=1 to split at the first space only, and str.extract with the short regular expression (\d+), read 'one or more digits, kept', pulls a number out of text typed in many different ways, where a plain replace would need a call for every wording.

By

Updated

Cheat sheet: Splitting and Extracting Text
Category
Data Analysis
Level
Journeyman
Tags
python, Regular Expression (python), str.extract(), str.split()