Suppose I have a data set that looks like this
Unique_Identifier Score1 Score2
112 50 60
113-114 50 70
115 40 20
116-117 30 90
118 70 70
Notice how some of my unique identifiers are listed as ranges, rather than exact values. I want to split up those ranges to each be 2 separate rows with the same scores so that it would look like this:
Unique_Identifier Score1 Score2
112 50 60
113 50 70
114 50 70
115 40 20
116 30 90
117 30 90
118 70 70
How would I go about doing this in Python using Pandas? I think there may be a way to test for rows that have a "-" in them, but I'm not sure how I would go about splitting those rows. I should also note that some identifier ranges have more than just 2 identifiers in them, such as 120-124.