I have the following column in pandas
Code |
---|
0.1.2 Contaminated land |
1.1.1 Standard foundations (default) |
1.1.2 Specialist foundations |
8.1.2 Preparatory groundworks |
How do I separate it into the following below?
Column A | Column B |
---|---|
0.1.2 | Contaminated land |
1.1.1 | Standard foundations (default) |
1.1.2 | Specialist foundations |
using the following code I get the below, which does not work.
df[['code', 'description']] = df['code'].str.split(' ', 1, expand=True)