Suppose I have a MNIST dataset in this way.
df = pd.read_csv('data/train.csv')
data = df.loc[df['label'].isin([1,6])]
I am trying to select only those rows whose column ['label'] == 1 or 6.
But, I am want to get only 500 rows from each column ['label']
How do I do it?