mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-04-26 15:13:56 +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
|
- http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.html
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from functools import reduce
|
||||||
|
|
||||||
def extractYear(v):
|
def extractYear(v):
|
||||||
return(pd.Series(reduce(lambda x, y: x + y, map(rx.findall, v), [])).astype(int))
|
return(pd.Series(reduce(lambda x, y: x + y, map(rx.findall, v), [])).astype(int))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user