Stack Python Code Using Pandas For Frequency