I am currently exploring a dataset in CSV format having values like the following:
example 1, class 1
example 2, class 1, class 2
example 3, class 2,
example 4, class 1, class 2, class 4
The classes are assigned in variable length to each example as you can see. Is there any method (using numpy or pandas) that can help me transform this data to one class per instances? Just like the following:
example 1, class 1
example 2, class 1
example 2, class 2
example 3, class 2
example 4, class 1
example 4, class 2
example 4, class 4
I am doing this so that it can be fed to Neural Network models easily. I have tried several ways in pandas but so far no luck.