summaryrefslogtreecommitdiffhomepage
path: root/pythonstatcomp.html.markdown
diff options
context:
space:
mode:
authorTimothy Ubbens <timothyubbens@users.noreply.github.com>2018-10-15 23:22:34 -0400
committerTimothy Ubbens <timothyubbens@users.noreply.github.com>2018-10-15 23:22:34 -0400
commita5b7fe9e618c52399cf7bea539cafde7515a7b55 (patch)
tree1b8b86bd2680fc36d05526e59a7e783d2d3b8b43 /pythonstatcomp.html.markdown
parentcb12952d60909b0f68416190d3cc8e69b81085c8 (diff)
Add import to resolve changes in new versions of python
Diffstat (limited to 'pythonstatcomp.html.markdown')
-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))