summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--pythonstatcomp.html.markdown2
1 files changed, 2 insertions, 0 deletions
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))