I have a Pandas dataframe that looks like this:
| Location | Number | Position |
|---|---|---|
| New York | 111 | 1 through 12 |
| Dallas | 222 | 1 through 12 |
| San Francisco | 333 | 1 through 4 |
I would like to basically explode the dataframe based on the Position column so that the output looks like this:
| Location | Number | Position |
|---|---|---|
| New York | 111 | 1 |
| New York | 111 | 2 |
| New York | 111 | 3 |
| New York | 111 | 4 |
| New York | 111 | 5 |
| New York | 111 | 6 |
| New York | 111 | 7 |
| New York | 111 | 8 |
| New York | 111 | 9 |
| New York | 111 | 10 |
| New York | 111 | 11 |
| New York | 111 | 12 |
| Dallas | 222 | etc. etc. |
I would like to do this for every instance of Location and Number based on what the values in Position are.
Is there a quick and easy way to do this??