Numpy reverse keras to_categorical
Simple.
numpy.argmax(a, axis=None, out=None)
This returns the indices of the maximum values along an axis.
Adding to MazeRunner09's answer. If you used to_categorical from keras, you will have a list and can use a list comprehension over the entire one-hot encoded list:
y_classes = [np.argmax(y, axis=None, out=None) for y in y_test]