1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-07-31 20:10:49 +02:00

Add import to resolve changes in new versions of python

This commit is contained in:
Timothy Ubbens
2018-10-15 23:22:34 -04:00
parent cb12952d60
commit a5b7fe9e61

View File

@@ -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))