My dataframe has a column (numbers_selected) and for each row, it looks like this:
1. 6-9-27
2. 2-3-6-8-30
3. 3-11-13-18
4. 3-14-15-17-18-30
5. 3-8-10-12-16
6. 3-7-8-27-29
7. 8-14-21
As you can see each row can have different amount of numbers.
What I am looking for is to see if it is possible to create a column for each of these numbers. There will be up to 6 columns as it is not possible to have more than 6 numbers in a row.
At the end, the dataset should look like these:
1st Number | 2nd Number | 3rd Number | 4th Number | 5th Number | 6th Number |
---|---|---|---|---|---|
6 | 9 | 27 | Null | Null | Null |
2 | 3 | 6 | 8 | 30 | Null |
3 | 11 | 13 | 18 | Null | Null |
3 | 14 | 15 | 17 | 18 | 30 |
3 | 8 | 10 | 12 | 16 | Null |
3 | 7 | 8 | 27 | 29 | Null |
8 | 14 | 21 | Null | Null | Null |
bar
The query I am using is:
Select Week, number_selected from x.
Hope you can help me with these, thanks!