Pivot table non numeric values pandas. If you use Python 3 use the following.