title: When apply a function to a list, it occurs "TypeError: 'Int64Index' object is not callable"
body: <p>I want to group by "objid", and get the first NONE-ZERO level within the same id. if within the same list, all level is 0, I will make it return 2. What I do is:</p>
  
  <pre><code>objid   level    color
  1        0        red
  1        1        blue
  1        2        yellow
  2        0        white
  3        1        red
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>objid  level    
  1       1        
  2       2        
  3       1  
  
  def titleNot0(ls):
      try:
          Not0= ls.index(filter(lambda x:x!=0,ls)[0])
          return ls[Not0]
      except IndexError:
          return 2
  userTitle = JobData.groupby("candidate_id")["TitleLevel"].apply(titleNot0)
  </code></pre>
  
  <p>I have tried on some simple list like: <code>x=[0,1,2],  titleNot0(x)</code>. It works. But if I apply the function to the groupby, it returns "TypeError". Please help me to fix it. Thank you!</p>