How to shift rows values as columns in pandas?
You want pandas.get_dummies.

If you call get_dummies on a categorical column, it will output the binary dummy variables you're looking for. You should then be able to merge this with your original DataFrame on the index, or construct a new DataFrame using only the columns you want.