Python Sélectionnez un sous-ensemble aléatoire dans le tableau Numpy

fruits = ['apple', 'banana', 'orange', 'grape']
subset_size = int(0.7 * len(fruits))
np.random.choice(fruits, subset_size, replace=False)
# array(['grape', 'banana'], dtype='<U6')
Caleb McNevin