I have a wide-sparse dataframe as the following
pd.DataFrame({"B.count": [0, 0, 1, 0, 0],
"B.score": [0, 0, 87,0 ,0],
"C.count": [0, 1, 0, 1, 0],
"C.score": [0, 91, 0, 14, 0],
"D.count": [1, 0, 10, 0, 11],
"D.score": [93, 0, 3, 0, 4]},
index = [1,2,3,4,5])
and I would like to convert it into a long-dense sparse format.
pd.DataFrame({"id": [1, 2, 3, 3, 4, 5],
"taste": ["D", "C", "B", "D", "C", "D"],
"count": [1, 1, 1, 10, 1, 11],
"score": [93, 91, 87, 3, 14, 4]})
It seems the solution must be through the wide_to_long function, but unfortunately, I can't make it to work.

