I asked a similar question on here before, but I realize now that the data I am working with has an additional layer of complexity.
Suppose I have a data set that looks like this
Unique_Identifier Score1 Score2
110 10 60
112,114-116 50 70
119 30 20
120-122 90 90
125,127 70 80
Notice how some of my unique identifiers are listed as ranges, rather than exact values. I want to split up those rows such that each Unique Identifier has it's own row with the same data so that it would look like the following table. "," represents a separation of values, whereas "-" represents a range of values.
Unique_Identifier Score1 Score2
110 10 60
112 50 70
114 50 70
115 50 70
116 50 70
119 30 20
120 90 90
121 90 90
122 90 90
125 70 80
127 70 80
How would I go about doing this in Python using Pandas? I believe the answers to the more simple version the last time I asked this involved an explode function. I should also note that there are indeed no spaces in the Unique Identifier column when , or - are present.