ENH: pep8 setup.py and fixed template exceptions when dataframe is empty