def compose_date(years, months=1, days=1, weeks=None, hours=None, minutes=
    None, seconds=None, milliseconds=None, microseconds=None, nanoseconds=None
    ):
    years = np.asarray(years) - 1970
months = np.asarray(months) - 1
days = np.asarray(days) - 1
types = ('<M8[Y]', '<m8[M]', '<m8[D]', '<m8[W]', '<m8[h]', '<m8[m]',
    '<m8[s]', '<m8[ms]', '<m8[us]', '<m8[ns]')
vals = (years, months, days, weeks, hours, minutes, seconds, milliseconds,
    microseconds, nanoseconds)
return sum(np.asarray(v, dtype=t) for t, v in zip(types, vals) if v is not None
    )
df = pd.DataFrame({'doy': [49, 65, 81, 97, 113, 129, 145, 161], 'year': [
    2000, 2000, 2000, 2001, 2001, 2001, 2001, 2001]})
Преобразование года и дня года в индекс даты и времени в пандах