我有以下需要的情况
col1 col2 col3
jgjedjh:50K:huhuhuhuh ioioioioioi :67L:hghghghg 50K huhuhuhuh
vjvvjjvjhv:50k:hjhjhjh iuiuiu:45B:\jhjhjhjhfltltltlt klklklkl 45B \jhjhjhjhfltltltlt
我正在执行以下操作:-
def extract(x,y):
res = []
for i in range(len(x)):
ix = y.iloc[i].find(x.iloc[i]) + len(x.iloc[i])
print(ix)
res.append(y.iloc[i].find([ix+1:ix+15]).split("\r\n"))
return res
df['col3']=extract(df['col2'].astype(str),df['col1'])
与此有关,我没有得到正确的结果。有人可以帮忙吗?