The Pandas.melt() function is used to unpivot the DataFrame from a wide format to a long format.
Its main task is to massage a DataFrame into a format where some columns are identifier variables and remaining columns are considered as measured variables, are unpivoted to the row axis. It leaves just two non-identifier columns, variable and value.
It returns the unpivoted DataFrame as the output.
Name Language Age 0 Parker Python 22 1 Smith Java 30 2 John C++ 26
A myVarname myValname 0 p C 56 1 q C 62 2 r C 42