I am trying to use the islice function but am getting the following error:
Traceback (most recent call last):
File "/Users/gavinnachbar/Session 3 copy/all_in_one_almost.py", line 168, in <module>
all_decisions.extend(islice(reader,4))
NameError: name 'islice' is not defined
I have imported itertools but am still getting the error, any idea why?
... because you are trying to import iterator, which does not exist?
Edit:
Have you tried either
from itertools import islice
or
all_decisions.extend(itertools.islice(reader,4))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With