title: Passing column values into lambda function in Pandas
body: <p>I am trying to create a new column for the lower confidence interval using other values in the row. I have written (and released) the confidence interval calculations as a package <code>public-health-cis</code> on <code>pypi</code>. These functions take in float values and return a float.</p>
  
  <p>In my analysis script, I am trying to call this function from a pandas dataframe. I have tried several options to attempt to get this working, to no avail. </p>
  
  <pre><code>    df_for_ci_calcs = df[['Value', 'Count', 'Denominator']].copy()
      df_for_ci_calcs = df_for_ci_calcs.applymap(lambda x: -1 if x == '*' else x)
      df_for_ci_calcs = df_for_ci_calcs.astype(np.float)
      df['LowerCI'].apply(lambda x: public_health_cis.wilson_lower(df_for_ci_calcs['Value'].astype(float),
                                        df_for_ci_calcs['Count'].astype(float), 
                                        df_for_ci_calcs['Denominator'].astype(float), indicator.rate))
  </code></pre>
  
  <p>Comes back with this traceback:</p>
  
  <blockquote>
    <p>Internal Server Error: /  </p>
  </blockquote>
  
  <pre><code>df['LowerCI'].apply(lambda x: public_health_cis.wilson_lower(df_for_ci_calcs['Value'].astype(float), df_for_ci_calcs['Count'].astype(float), df_for_ci_calcs['Denominator'].astype(float), indica
  tor.rate))   
  
  TypeError: cannot convert the series to &lt;class 'float'&gt;
  </code></pre>
  
  <p>I have also tried using:</p>
  
  <pre><code>df['LowerCI'] = df_for_ci_calcs.applymap(lambda x: public_health_cis.wilson_lower(df_for_ci_calcs['Value'], df_for_ci_calcs['Count'],
                                                           df_for_ci_calcs['Denominator'], indicator.rate), axis=1)
  </code></pre>
  
  <p>which delivers the error:</p>
  
  <p><code>applymap() got an unexpected keyword argument 'axis'</code></p>
  
  <p>When I take the axis kwarg out, I get the same error as the first method. So, how do I pass values from each row into a function to get a value based on the data in those rows?</p>