I am trying to write some code to create a new column in a dataframe(ad_clicks) that checks if one column(ad_click_timestamp) has values- if it has no values (ie column value is None), it puts False. Else, if the column does have values, it puts True in the new column. But I am stuck with how to compare the value in the lambda function as below-
lam= lambda x: False if x.isnull() else True ad_clicks['is_click']=ad_clicks.ad_click_timestamp.apply(lam)
And it is not running. Error shown is-
AttributeError: ‘str’ object has no attribute ‘isnull’
What am I doing wrong?