title: Cut substring on multiple columns when one column contains a particular substring
body: <p>I want to cut a certain part of a string (applied to multiple columns and differs on each column) when one column contains a particular substring</p>
  <p>Example:
  Assume the following dataframe</p>
  <pre><code>import pandas as pd
  df = pd.DataFrame({'name':['Allan2','Mike39','Brenda4','Holy5'], 'Age': [30,20,25,18],'Zodiac':['Aries','Leo','Virgo','Libra'],'Grade':['A','AB','B','AA'],'City':['Aura','Somerville','Hendersonville','Gannon'], 'pahun':['a_b_c','c_d_e','f_g','h_i_j']})
  print(df)
  </code></pre>
  <p>Out:</p>
  <pre><code>    name    Age     Zodiac  Grade   City            pahun
  0   Allan2  30      Aries   A       Aura            a_b_c
  1   Mike39  20      Leo     AB      Somerville      c_d_e
  2   Brenda4 25      Virgo   B       Hendersonville  f_g
  3   Holy5   18      Libra   AA      Gannon          h_i_j
  </code></pre>
  <p>For example if one entry of column City ends with 'e', cut the last three letters of column 'City' and the last two letters of column 'name'.</p>
  <p>What I tried so far is something like this:</p>
  <pre><code>df['City'] = df['City'].apply(lambda x: df['City'].str[:-3] if df.City.str.endswith('e'))
  </code></pre>
  <p>That doesn't work and I also don't really know how to cut letters on other columns while having the same if clause.</p>
  <p>I'm happy for any help I get.
  Thank you</p>