I have a dataframe. I want to get the list of all values of different classes.
df = pd.DataFrame([(3, 1),
(4, 3),
(6, 2),
(7, 2),
(2, 3),
(4, 2),
(4, 1),
(1, 3),
(6, 3),
(8, 1)],
columns=['Feature', 'Class'])
In the above example, I have three classes, namely 1, 2, and 3. I would like to get the output of all different lists of values in a class. The output can be following:
Class 1: [3, 4, 8]
Class 2: [6, 7, 4]
Class 3: [4, 2, 1, 6]