我從文本文件加載了 IRIS 數(shù)據(jù)集 -data = np.genfromtxt('../Data/bezdekIris.csv',delimiter=',',usecols=[0,1,2,3,4],dtype=None)這有格式的數(shù)據(jù)ndarray [(5.1, 3.5, 1.4, 0.2, 'Iris-setosa') (4.9, 3. , 1.4, 0.2, 'Iris-setosa') (4.7, 3.2, 1.3, 0.2, 'Iris-setosa') (4.6, 3.1, 1.5, 0.2, 'Iris-setosa') (5. , 3.6, 1.4, 0.2, 'Iris-setosa')]我如何隨機(jī)排序
1 回答

素胚勾勒不出你
TA貢獻(xiàn)1827條經(jīng)驗(yàn) 獲得超9個(gè)贊
import numpy as np
np.random.seed(12345) # For repeatable results
np.random.shuffle(data)
洗牌就地完成。
添加回答
舉報(bào)
0/150
提交
取消