Usually in training neural networks with Keras for example, we need to create a X feature array and also a Y target array. And the Y target array should be one-hot encoded. For instance, X and Y can be something like this:
Y = np.array([[1,0,0],[1,0,0],[0,1,0],[0,1,0],[0,0,1],[0,0,1]])
X = np.array([[3,3,1],[3,3,2],[2,2,2],[2,2,1],[1,1,5],[1,2,4]])
Say if you like to consider only training examples with one unique target, thus we need to remove rows with duplicate ones in Y and remove the similar rows in X correspondingly, so you will end up with:
Y = np.array([[1,0,0],[0,1,0],[0,0,1]])
X = np.array([[3,3,1],[2,2,2],[1,1,5]])
How do we do so?