title: Python isnull() - using Lambda on a row
body: <p>I am trying to add a column to a dataframe - ad_clicks.</p>
  <p>ad_clicks already has a column - ad_click_timestamp which has time values if a customer clicked on the website. If he/she did not, then the value in the cell is nan.</p>
  <p>If I do this -</p>
  <pre><code>ad_clicks['is_click'] = ~ad_clicks.ad_click_timestamp.isnull()
  </code></pre>
  <p>it works.</p>
  <p>If I do this -</p>
  <pre><code>ad_clicks['is_click'] = ad_clicks.apply(lambda row : ~row.ad_click_timestamp.isnull(), axis = 1)
  </code></pre>
  <p>it throws me an error as follows -</p>
  <pre><code>AttributeError: (&quot;'str' object has no attribute 'isnull'&quot;, u'occurred at index 0')
  </code></pre>
  <p>As per my understanding - using apply without a specified column, the input to the lambda function becomes the row and by specifying the column to operate on - it selects that particular column for each row and performs the operation.</p>
  <p>So, why does the same expression work without the lambda - when applied to the column but not to with lambda when applied to the cell.</p>
  <p>What am I missing here? Thanks in advance for any explanation (or syntax correction that I may be missing).</p>