title: Using result_type with pandas apply function
body: <p>I want to use <a href="https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.apply.html" rel="noreferrer">apply</a> on a <a href="https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.html" rel="noreferrer">pandas.DataFrame</a> that I created, and return for each row a list of values, where each value is a column in itself.</p>
  
  <p>I wrote the following code:</p>
  
  <pre><code>import pandas as pd
  
  def get_list(row):
    return [i for i in range(5)]
  
  df = pd.DataFrame(0, index=np.arange(100), columns=['col'])
  
  
  df.apply(lambda row: get_list(row), axis=1, result_type='expand')
  </code></pre>
  
  <p>When I add <code>result_type='expand'</code> in order to change the returned array into separate columns I get the following error:</p>
  
  <pre><code>TypeError: ("&lt;lambda&gt;() got an unexpected keyword argument 'result_type'", 'occurred at index 0')
  </code></pre>
  
  <p>However if  I drop the <code>result_type</code> field it runs fine (returns a column of arrays), what might be the problem?</p>
  
  <ul>
  <li>I'm using <a href="https://colab.research.google.com" rel="noreferrer">colab</a> to run my code</li>
  </ul>