title: Pandas Apply/Lambda returning dataframe and not single row
body: <p>New to Python and Pandas, so please bear with me here. </p>
  
  <p>I have created a dataframe with 10 rows, with a column called 'Distance' and I want to calculate a new column (TotalCost) with <code>apply</code> and a lambda funtion that I have created. Snippet below of the function</p>
  
  <pre><code>def TotalCost(Distance, m, c):
      return m * df.Distance + c
  </code></pre>
  
  <p>where <code>Distance</code> is the column in the dataframe <code>df</code>, while <code>m</code> and <code>c</code> are just constants that I declare earlier in the main code. </p>
  
  <p>I then try to apply it in the following manner:</p>
  
  <pre><code>df = df.apply(lambda row: TotalCost(row['Distance'], m, c), axis=1)
  </code></pre>
  
  <p>but when running this, I keep getting a dataframe as an output, instead of a single row. </p>
  
  <p>EDIT: Adding in an example of input and desired output,</p>
  
  <pre><code>Input: df = {Distance: '1','2','3'}
  </code></pre>
  
  <p>if we assume m and c equal 10,
  then the output of applying the function should be </p>
  
  <pre><code>df['TotalCost'] = 20,30,40
  </code></pre>
  
  <p>I will post the error below this, but what am I missing here? As far as I understand, my syntax is correct. Any assistance would be greatly appreciated :)</p>
  
  <p>The error message:</p>
  
  <pre><code>ValueError: Wrong number of items passed 10, placement implies 1
  </code></pre>