我有df
,如下所示,我将按列进行拆分
>>> df
ID Started
0 NaN 20.06.2017 13:19:04
1 NaN 10.04.2018 04:48:32
2 WBTS-1509 06.11.2017 10:28:14
3 WBTS-1509 03.03.2018 10:12:29
4 WBTS-1117 07.03.2018 17:04:28
df['Started'].apply(lambda x: x.split(':')[0])
df['ID'].apply(lambda x: x.split('-')[1])
我想设置3个列表变量
col_names = ['ID' , 'Started']
splitby = ['-' , ':']
index_after_split = [1 , 0]
使用inplace = True
使用一行进行拆分(避免循环)
请帮我做同样的事
谢谢
我认为这里有必要使用^{} 循环,并使用
str[]
索引:相关问题 更多 >
编程相关推荐