I have a CSV file organized like this:
id, time, val
1, 0.1, a1, 0.2, a2, 0.3, a3, ...
2, 0.1, b1, 0.2, b2, 0.3, b3, ...
i.e. each row has one id
followed by many time, val
pairs (I'm not sure if this is even considered a valid CSV). Is there an easy way to split these rows into rows indexed by id
and time
? I.e.
id, time, val
1, 0.1, a1
1, 0.2, a2
1, 0.3, a3
...
2, 0.1, b1
2, 0.2, b2
2, 0.3, b3
Is there any standard terminology for the way this data is organized? I've struggled to find anything like it through simple google searches. I can certainly make a script from scratch which iterates through the file line-by-line and outputs what I need, but I'm worried that I will need to do this on a file that's large enough to complicate things. I'll be using Python to work with the data but I'm open to other technologies.
Any tips would be greatly appreciated!