How to Solve NameError: name 'sqldf' is not defined -- pandasql
Solution: Import the 'sqldf' module
To Solve the error, add the following line to the top of your code.
from pandasql import sqldf
For more information:
Python pandasql sqldf