title: How to pass multiple arguments to the apply function
body: <p>I have a method called counting that takes 2 arguments. I need to call this method using the apply() method. However when I am passing the two parameters to the apply method it is giving the following error:</p>
  
  <blockquote>
    <p>TypeError: counting() takes exactly 2 arguments (1 given)</p>
  </blockquote>
  
  <p>I have seen the following thread <a href="https://stackoverflow.com/questions/21188504/python-pandas-apply-a-function-with-arguments-to-a-series-update?lq=1">python pandas: apply a function with arguments to a series. Update</a> and I do not want to use functool.partial as I do not want to import additional classes to be able to pass parameters.</p>
  
  <pre><code>def counting(dic, strWord):
      if strWord in dic:
          return dic[strWord]
      else:
          return 0
  
  DF['new_column'] = DF['dic_column'].apply(counting, 'word')
  </code></pre>
  
  <p>If I give a single parameter, it works:</p>
  
  <pre><code>def awesome_count(dic):
      if strWord in dic:
         return dic[strWord]
      else:
         return 0
  
  DF['new_column'] = DF['dic_column'].apply(counting)
  </code></pre>