array([[2, 0, 1], [1, 2, 3]]) numpy中reshape(-1,1)與reshape(1,-1)的作用 如果你的數(shù)據(jù)只有一個(gè)特征,可以用reshape(-1,1)改變你的數(shù)據(jù)形狀;或者如果你的數(shù)據(jù)只包含一個(gè)樣本,可以使用reshape(1,-1)來改變。 1 2 e = np.array([1]) #只包含一個(gè)數(shù)據(jù) f = e.reshape(1,-1) #改變形狀...
www.dbjr.com.cn/article/2566...htm 2025-6-4