You could try finding the step that is taking the most time, using code similar to the following:
from time import time

start_time = time()
# Code suspected of being slow goes here  
print('{} elapsed time {}s'.format(time() - start_time))

Once you narrow the slowdown to a specific line, you can investigate it better.