I am trying to figure how to load my csv rows into a nested array.
For e.g., my csv file:
| id | a1 | a2 | b1 | b2 | c1 | c2 | d1 | d2 |
|---|---|---|---|---|---|---|---|---|
| 1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
| 3 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| ... |
How do I make it into an array like this:
for each row I want to group every two columns into what I am showing below:
[
[[1, 2], [3, 4], [5, 6], [7, 8]], #row 1
[[9, 10], [11, 12], [13, 14], [15, 16]], #row 2
[[17, 18], [19, 20], [21, 22], [23, 24]], #row 3
...
]