【发布时间】:2019-03-16 20:01:39
【问题描述】:
我有一个包含 2 列的数据框
col1 col2
1 cat the cat
2 dog a nice dog
3 horse horse is here
我需要找到 col1 的每个字符串在 col2 中的位置。
解决方案必须是:
col1 col2 col3
1 cat the cat 4
2 dog a nice dog 7
3 horse horse is here 0
必须有一个简单的解决方案来做到这一点而不使用痛苦的循环,但我找不到它。
【问题讨论】: