I want to label-encode list of tuples using sklearn.preprocessing.LabelEncoder, such as:
[(4,5), (6, 7), (1, 1), (6, 7), ... ]
So that every tuple gets a unique label. However, this structure gets converted to 2D np.ndarray which is the cause of the following error:
ValueError: y should be a 1d array, got an array of shape (N, 2) instead.
How can I manipulate my initial structure so that it can be encoded properly (I assume this is the only solution since LabelEncoder is not configurable) ?