mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 09:41:36 +00:00
Add import to resolve changes in new versions of python
This commit is contained in:
parent
cb12952d60
commit
a5b7fe9e61
@ -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))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user