''' Author: 365JHWZGo Description: numpy.flatten Date: 2021/11/4 19:34 FilePath: day1104-3.py ''' import numpy as np a = np.linspace(1,10,10).reshape(2,5) #array c = np.mat([[1,2],[2,3],[3,4]]) #mat f = a.ravel() print('a:',a) b = a.flatten() print('f:',f) print('b:',b) d = c.flatten() print('d:',d) e = c.flatten().A[0] print('e:',e)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)