You are looking for melt
(aka "univot"):
In [11]: df = pd.DataFrame([["a", "b", 43, 87, 29]], columns=["N", "P", 1, 2, 3])
In [12]: pd.melt(df, id_vars=["N", "P"], value_vars=[1, 2, 3], var_name="Day")
Out[12]:
N P Day value
0 a b 1 43
1 a b 2 87
2 a b 3 29
source
share