How to pivot a pandas Dataframe in Python?

pandas pivot table to dataframe
pandas pivot multiple columns
pandas pivot multiindex
valueerror: index contains duplicate entries, cannot reshape
pandas melt
pandas pivot vs pivot_table
pandas pivot table column names
pandas pivot count