I was trying to do the same thing with the question here, and followed the method given by the answers. Here is my code:
import pandas as pd import xlsxwriter