From a5b7fe9e618c52399cf7bea539cafde7515a7b55 Mon Sep 17 00:00:00 2001 From: Timothy Ubbens Date: Mon, 15 Oct 2018 23:22:34 -0400 Subject: Add import to resolve changes in new versions of python --- pythonstatcomp.html.markdown | 2 ++ 1 file changed, 2 insertions(+) (limited to 'pythonstatcomp.html.markdown') 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)) -- cgit v1.2.3