I have txt file like this:
Name | Class | Points
--------------------------
Name1 | (2) | 30
Name1 | (3) | 50
Name1 | (5) | 15
Name2 | (1) | 25
Name2 | (3) | 88
Name2 | (4) | 3
There are 100 unique values under the column class
: [(1), (2), (3), ..., (100)]
I would like to populate the values based on the class
value, so the new table will have the classes as the columns like this:
| (1) | (2) | (3) | (4) | (5) |...
----------------------------------------------
Name1 | | 30 | 50 | | 15 |
Name2 | 25 | | 88 | 3 | |
Explanation for Name1
:
In the first table (the original format from the file), the
Name1
has 30 points for class(2)
, 50 points for class(3)
, and 15 points for class(5)