title: Passing a function with multiple arguments to DataFrame.apply
body: <p>Suppose I have a dataframe like this:</p>
  
  <pre><code>df = pd.DataFrame([['foo', 'x'], ['bar', 'y']], columns=['A', 'B'])
  
  
         A    B
  0    foo    x
  1    bar    y
  </code></pre>
  
  <p>I know how to use a single argument function with Apply when it comes to dataframes, like this:</p>
  
  <pre><code>def some_func(row):
      return '{0}-{1}'.format(row['A'], row['B'])
  
  df['C'] = df.apply(some_func, axis=1)
  
  df
  
  
         A    B        C
  0    foo    x    foo-x
  1    bar    y    bar-y
  </code></pre>
  
  <p>How can I use apply on dataframes when they involve multiple input arguments? Here's an example of what I want:</p>
  
  <pre><code>def some_func(row, var1):
      return '{0}-{1}-{2}'.format(row['A'], row['B'], var1)
  
  df['C'] = df.apply(some_func(row, var1='DOG'), axis=1)
  
  df
  
  
         A    B            C
  0    foo    x    foo-x-DOG
  1    bar    y    bar-y-DOG
  </code></pre>
  
  <p>I'm not looking for work-arounds to solve this one particular example, just how to do something like this in general. Any advice would be well appreciated, thanks.</p>