For example, I have follow pandas DataFrame:
import pandas as pd
df = pd.DataFrame(data=[[1, 2, 3], [4, 5, 6]], columns=['a', 'b', 'c'])
print(df)
a b c
0 1 2 3
1 4 5 6
I want to convert it into below format:
field data
0 a 1
1 a 4
2 b 2
3 b 5
4 c 3
5 c 6
The original column name as the new colume field
value, and the data is the original data of column, how to implement this?