Time series interpolation

One option is to convert the dates to number of days:

itp = LinearInterpolation(Dates.days.(dt), y)
dt1 = Date(1900,1,1):Day(1):Date(1902,1,1)
y1 = itp(Dates.days.(dt1))

Anoter way of getting number of days as floats is:

(dt .- dt[1])/Day(1)

NB:
As @DNF would say, do not use collect, unless really necessary.

1 Like