Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

split a column into multiple columns

df[['A', 'B']] = df['AB'].str.split(' ', 1, expand=True)
df['A'], df['B'] = df['AB'].str.split('-', 1).str
Source by gist.github.com #
 
PREVIOUS NEXT
Tagged: #split #column #multiple #columns
ADD COMMENT
Topic
Name
9+1 =