I have a huge numpy 2d array, each value is a category between 0 and 3:
[[3 1 0 ... 1]
...
[2 0 1 ... 3]]
I want to one-hot-encode it (0 is 0 0 0 1, 1 is 0 0 1 0, etc), so the above will become:
[[1 0 0 0 0 0 1 0 0 0 0 1 ... 0 0 1 0]
...
[0 1 0 0 0 0 0 1 0 0 1 0 ... 1 0 0 0]]
What will be the most efficient way to do that? Thanks!