import pandas as pd
# 原数据
df = pd.DataFrame({
'name':['cherish','odin','mark'],
'address':['广州-增城区','深圳-龙华区','上海-黄浦区']})
df1 = df.address.str.split('-',expand=True)
# 处理后的数据
res = pd.concat([df['name'],df1], axis=1)
df
df1
res
import pandas as pd
# 原数据
df = pd.DataFrame({
'name':['cherish','odin','mark'],
'address':['广州-增城区','深圳-龙华区','上海-黄浦区']})
df1 = df.address.str.split('-',expand=True)
# 处理后的数据
res = pd.concat([df['name'],df1], axis=1)
df
df1
res