title: Get substring in one column based on the value in another column
body: <p>My dataframe looks like this: </p>
  
  <pre><code>test_df = pd.DataFrame({'name':['a12','b1','c'],'Length':[2,1,0]})
  test_df
  
      Length  name
  0   2   a12
  1   1   b1
  2   0   c
  </code></pre>
  
  <p>I would like to have a result like this:</p>
  
  <pre><code>    Length  name
  0   2   a
  1   1   b
  2   0   c
  </code></pre>
  
  <p>With this code: <a href="https://stackoverflow.com/questions/39767787/getting-substring-based-on-another-column-in-a-pandas-dataframe">Getting substring based on another column in a pandas dataframe</a></p>
  
  <pre><code>test_df.apply(lambda x: x['name'][:-x['Length']],axis = 1)
  test_df
  </code></pre>
  
  <p>I got the same dataframe than before</p>
  
  <pre><code>    Length  name
  0   2   a12
  1   1   b1
  2   0   c
  </code></pre>