title: Passing additional arguments to python pandas DataFrame apply
body: <p>I have a DataFrame df and I tried to iterate each row to map values of two columns to new values, but I have problems passing in the dictionary containing the map to df.apply </p>
  
  <pre><code>df.apply(lambda row: (map_dict[row['colA']], map_dict[row['colB']]), axis=1, args=(map_dict,), map_dict=map_dict)
  </code></pre>
  
  <p>I got the error message</p>
  
  <pre><code>File "&lt;console&gt;", line 1
  SyntaxError: Generator expression must be parenthesized if not sole argument
  </code></pre>
  
  <p>I tried to read the official doc , but I struggle to understand its explanation on args parameter <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.apply.html" rel="noreferrer">http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.apply.html</a></p>
  
  <p>I have also tried passing in map_dict as either keyword or positional argument, but I still get the same error</p>