How to Solve NameError: name 'OrderedSet' is not defined -- ordered_set

Solution: Import the 'OrderedSet' module

To Solve the error, add the following line to the top of your code.

from ordered_set import OrderedSet

 

For more information:
Python ordered_set OrderedSet