Python Optimizing This Pandas Transformation Stack Overflow

Python Optimizing This Pandas Transformation Stack Overflow