I currently have a wide dataframe that looks like this:
Index ID1 ID2 Foc_A Foc_B Foc_C Sat_A Sat_B Sat_C
0 r 1 10 15 17 100 105 107
1 r 2 20 25 27 110 115 117
2 s 1 30 35 37 120 125 127
3 s 2 40 45 47 130 135 137
Each entry has multiple identifier columns (ID1 and ID2). I then have two separate categories of measurements (Foc and Sat) each of which contains multiple identifiers (A, B, C)(the category identifiers are shared between categories). I'm eventually needing to plot it in a facet_grid with x and y as each category of measurement and separated by category identifier, so I'm trying to reshape it so that it looks like this:
Index ID1 ID2 Ch Foc Sat
0 r 1 A 10 100
1 r 1 B 15 105
2 r 1 C 17 107
3 r 2 A 20 110
4 r 2 B 25 115
5 r 2 C 27 117
6 s 1 A 30 120
7 s 1 B 35 125
8 s 1 C 37 127
I've been trying .melt, .pivot, and .stack but not understanding what I'm doing well enough to make headway.