Ive come across some slight confusion in the “aggregates in pandas” project.
Task asks me to create a new column based on an evaluation of an existing column, new column should display true if the existing column contains data and false if its NaN.
The project suggests the following method:
ad_clicks['is_click'] = ~ad_clicks\ .ad_click_timestamp.isnull()
Just because im awkward, I wanted to code this as a lambda instead:
d_clicks['is_click'] = ad_clicks.ad_click_timestamp.apply(lambda x: False if x.isnull() else True)
However this just throws an error about a string not having the isnull property.