title: .str.split() is removing the last character
body: <pre><code>def clean_hrefs(allHrefs): 
      links = {'links' : allHrefs}
      df = pd.DataFrame(links).drop_duplicates()
      df = df[df['links'].str.contains('financial|investors|investor|Investors|Investor|INVESTORS|INVESTOR|relations|relation|Relations|Relation|report|filings|news|media')]
      df['segment'] = df['links'].str.split(r'\w/')
      return df
  </code></pre>
  <p>clean_hrefs() function accepts a beautiful soup resultant set 'allHrefs' which contains all the href values of a webpage, and assigns it in a dictionary links. df dataframe stores only unique and those links which have certain keywords in them.</p>
  <p>After that I tried splitting the links I got so far like :
  for example the first link stored in the data frame was :</p>
  <blockquote>
  <p>https://www.example.com/news-and-media/press-releases?page=/en/pressreleases/example-performs-first-crash-test-of-an-e-scooter-airbag-1769461</p>
  </blockquote>
  <p>The code :</p>
  <pre><code>df['segment'] = df['links'].str.split(r'\w/')
  </code></pre>
  <p>is creating another column called segments and giving the following output :</p>
  <pre><code>['https://www.example.co', 'news-and-medi', 'press-releases?page=/e', 'pressrelease', 'example-performs-first-crash-test-of-an-e-scooter-airbag-1769461']
  </code></pre>
  <p>Where as I want the output to be :</p>
  <pre><code>['https://www.example.com', 'news-and-media', 'press-releases?page=','en', 'pressreleases', 'example-performs-first-crash-test-of-an-e-scooter-airbag-1769461']
  </code></pre>
  <p>Any help would be appreciated!</p>