diff --git a/pythonstatcomp.html.markdown b/pythonstatcomp.html.markdown index 5444769a..4cff3535 100644 --- a/pythonstatcomp.html.markdown +++ b/pythonstatcomp.html.markdown @@ -186,6 +186,8 @@ rx = re.compile(r'\d+$') # match trailing digits - http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.html """ +from functools import reduce + def extractYear(v): return(pd.Series(reduce(lambda x, y: x + y, map(rx.findall, v), [])).astype(int))