📅  最后修改于: 2022-03-11 14:45:03.991000             🧑  作者: Mango
fruits = ['apple', 'banana', 'orange', 'grape']
subset_size = int(0.7 * len(fruits))
np.random.choice(fruits, subset_size, replace=False)
# array(['grape', 'banana'], dtype='