title: select data in a column of a pandas dataframe depending on pieces of string in another column
body: <p>I have a dataframe with column 'a' which is a list of kids and column 'b' which is the number of toys for each kid</p>
  
  <pre><code>dic = { 'a': [ 'pippo', 'giovanni', 'giacomo', 'giovanni', 'giovanni', 'pippo'],\
             'b': [ 3, 5, 1, 10, 7, 8]}
  df = pd.DataFrame(dic)
  </code></pre>
  
  <p>The dataframe is</p>
  
  <pre><code>    a           b
  0   pippo       3
  1   giovanni    5
  2   giacomo     1
  3   giovanni    10
  4   giovanni    7
  5   pippo       8
  </code></pre>
  
  <p>In this case some of the kids are repeted over the dataframe, if I want to know how many toys has giovanni, than I just have to write this</p>
  
  <pre><code>df['b'][ df['a'] == 'giovanni' ]
  
  
  1   5
  3   10
  4   7
  </code></pre>
  
  <p>The sum of of the numbers on the second column are the number of toys that giovanni has ( 5 + 10 + 7 = 22).</p>
  
  <p>But how can I figure out the number of toys owned by giovanni if the last two letters of his name are not properly written? Here the situation</p>
  
  <pre><code>dic = { 'a': [ 'pippo', 'giovanLi', 'giacomo', 'giovanNi', 'giovanMi', 'pippo'],\
             'b': [ 3, 5, 1, 10, 7, 8]}
  df = pd.DataFrame(dic)
  </code></pre>
  
  <p>the dataframe is</p>
  
  <pre><code>    a           b
  0   pippo       3
  1   giovanLi    5
  2   giacomo     1
  3   giovanNi    10
  4   giovanMi    7
  5   pippo       8
  </code></pre>
  
  <p>I would like something like this</p>
  
  <pre><code>df['b'][ df['a'][:-2] == 'giovan'  ]
  </code></pre>
  
  <p>that select all the numbers of toys from the fact that in column b there is a string that starts with 'giovan'.</p>
  
  <p>What do you suggest me?</p>