Queue Python Code Using Pandas