I want to create a new boolean column that has a 0/1 depending if the ts_booking_at is null or not.
Currently I'm using the following code:
contacts.iloc[contacts["ts_accepted_at"] is np.nan, "accept"] = False
contacts.iloc[contacts["ts_accepted_at"] is not np.nan, "accept"] = True
But the following error returns
IndexError: only integers, slices (:
), ellipsis (...
), numpy.newaxis (None
) and integer or boolean arrays are valid indices