how to convert df long format to wide format code example Example: reshape wide to long in pandas pd.DataFrame(df.unstack().reset_index())