I'm trying to flip values and index in this manner:
df = pd.DataFrame({"day1":{"JOHN":"A","JANE":"B","JILL":"C"},"day2":{"JOHN":"A","JANE":"C","JILL":np.nan},"day3":{"JOHN":"C","JANE":"A","JILL":"B"}})
df
day1 day2 day3
JOHN A A C
JANE B C A
JILL C NaN B
looking for:
day1 day2 day3
A JOHN JOHN JANE
B JANE NaN JILL
C JILL JANE JOHN
I'm having trouble conceptualizing how to tackle that. My mind jumps to pivoting somehow, but I'm not getting anywhere.
Thanks