How to Solve NameError: name 'namedtuple' is not defined -- collections

Solution: Import the 'namedtuple' module

# Add the following line to the top of your code
from collections import namedtuple

 

For more information:
collections namedtuple