def to_series(knowledge_dates, earning_dates):
 return pd.Series(index=pd.to_datetime(knowledge_dates), data=pd.to_datetime(earning_dates))

def to_series ( knowledge_dates , earning_dates ) : return pd . Series ( index = pd . to_datetime ( knowledge_dates ) , data = pd . to_datetime ( earning_dates ) )
helper for converting a dict of strings to a series of datetimes .