How do I melt a pandas dataframe?
Note for pandas versions < 0.20.0: I will be using df.melt(…) for my examples, but you will need to use pd.melt(df, …) instead. Documentation references: Most of the solutions here would be used with melt, so to know the method melt, see the documentation explanation. Unpivot a DataFrame from wide to long format, optionally leaving … Read more