I am trying to create a custom function that subtracts two dates but have been getting this error when converting to days - 'NaTType' object has no attribute 'days'
class DateRange(CustomFactor):
inputs = [morningstar.share_class_reference.ipo_date]
window_length = 1
dtype = np.dtype('datetime64[ns]')
def compute(self, today, assets, out, date):
for ii, d in enumerate(date[0,:]):
date1 = pd.Timestamp(d, tz='UTC', offset='C')
delta = today - date1
out[ii] = delta.days
is there a fix? Thanks!