We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello, I'm at mission 610 and I have a problem when I try replace the full date with just the year:
This is the code I'm using.
for row in data: date = fetch_year(row[0]) row[0] = date
This is the error I get...
TypeError Traceback (most recent call last) <ipython-input-10-8a078f6cee5c> in <module> 1 for row in data: ----> 2 date = fetch_year(row[0]) 3 row[0] = date ~/notebook/helper.py in fetch_year(date_string) 10 11 def fetch_year(date_string): ---> 12 return int(re.findall("\d{4}", date_string)[0]) 13 14 def barplot(list_of_2_element_list): /dataquest/system/env/python3/lib/python3.8/re.py in findall(pattern, string, flags) 237 238 Empty matches are included in the result.""" --> 239 return _compile(pattern, flags).findall(string) 240 241 def finditer(pattern, string, flags=0): TypeError: expected string or bytes-like object
The text was updated successfully, but these errors were encountered:
Bro write this code instead for row in data: row[0] = fetch_year(row[0])
Sorry, something went wrong.
No branches or pull requests
Hello, I'm at mission 610 and I have a problem when I try replace the full date with just the year:
This is the code I'm using.
This is the error I get...
The text was updated successfully, but these errors were encountered: