title: Dataframe split before a specific string for all rows
body: <p>I have a dataframe (df) that contains 30 000 rows coming from a web scraping exercice</p>
  <pre><code>Name     NameID                                                            Age
  
  John     www.link.com/www.link.com/https://www.link.com/ct/John             25
  Samanta  www.link.com/www.link.com/https://www.link.com/ct/Samanta          24
  Johnny   www.link.com/www.link.com/                                         22
  Mary     www.link.com/www.link.com/https://www.link.com/ct/Mary             35
  </code></pre>
  <p>I want to clean the &quot;NameID&quot; row in a way where i only read &quot;https://www.link.com/ct/ &quot; part. So my output dataframe should look like this :</p>
  <pre><code> Name     NameID                                  Age
  
  John     https://www.link.com/ct/John             25
  Samanta  https://www.link.com/ct/Samanta          24
  Johnny                                            22
  Mary     https://www.link.com/ct/Mary             35
  </code></pre>
  <p>My code so far:</p>
  <pre><code>df['NameID'] = df['NameID'].str.split(&quot;https://www.link.com/ct/&quot;)[1][1]
  df['NameID'] =  &quot;https://www.link.com/ct/&quot; + df['NameID'].astype(str)
  </code></pre>
  <p>The output looks like this now:</p>
  <pre><code>Name     NameID                                  Age
  
  John     https://www.link.com/ct/John             25
  Samanta  https://www.link.com/ct/John             24
  Johnny   https://www.link.com/ct/John             22
  Mary     https://www.link.com/ct/John             35
  </code></pre>
  <p>Any help?</p>