title: pandas type error when trying to modify values of a column
body: <p>I have csv file that looks something like this</p>
  
  <pre><code>     x     y  z 
  0  a_b_c  30 40
  1  d_e_f  50 57
  </code></pre>
  
  <p>I am trying to modify column x by splitting the string at the first underscore and only keeping the string right before it. Based on this <a href="https://stackoverflow.com/a/13682381/6943310">answer</a> I came up with the following solution: </p>
  
  <pre><code>df['x'] = df['x'].map(lambda x: x.str.split('_').str[0])
  </code></pre>
  
  <p>However, i get an error message </p>
  
  <pre><code>TypeError: only integer scalar arrays can be converted to a scalar index
  
  </code></pre>