I am working on the A/B testing for shoefly.com
The task says " If the column
ad_click_timestamp is not null, then someone actually clicked on the ad that was displayed. Create a new column called
is_click , which is True if
ad_click_timestamp is not null and
The hint says "
ad_clicks['is_click'] = ~ad_clicks.ad_click_timestamp.isnull()" this makes sense although in the lessons I thought you had to create a lamba function in order to do this.
So, my original approach was
ad_clicks['is_click'] = ad_clicks.ad_click_timestamp.apply(lambda x: False if x.isnull() else True)
But I get an error saying
'str' object has no attribute 'isnull'. Can someone explain why the hint code, which applies “isnull()” to ad_click_timestamp works but using it the way i did it doesn’t?