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