擅长:python、mysql、java
<p>您可以按如下方式循环以获得结果-</p>
<p><strong>代码-</strong></p>
<pre><code>for i in range(len(df)):
string = df['Names'][i]
df['Index'][i] = string.find(',',0,len(string))
</code></pre>
<p><strong>输出</strong></p>
<p><a href="https://i.stack.imgur.com/CDo3F.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CDo3F.png" alt="enter image description here"/></a></p>