Stack Python Code Using Pandas Dataframe