Split rows according to text in two columns (Python, Pandas)
问题 This is my dataframe (with many more letters and a length of ~35.5k) and stuff where the – are other relevant strings). All the variables are strings and ['C1','C2'] is the MultiIndex. tmp C1 C2 C3 C4 C5 Start End C8 A 1 - - - 12 14 - A 2 - - - 1,4,7 3,6,10 - A 3 - - - 16,19 17,21 - A 4 - - - 22 24 - I need it to become this (split every row that contains commas maintaining everything else): C1 C2 C3 C4 C5 Start End C8 Appearance A 1 - - - 12 14 - 1 A 2 - - - 1 3 - 1 A 2 - - - 4 6 - 2 A 2 - -