list不具有array的全部属性(如维度、转置等)。
代码:(推荐学习:Python视频教程)
#eg1_1 import numpy as np a = np.array([[1,2,0,1],[1,6,9,55],[7,8,9,5]])#a为数组 print(a.T) #Result: [[ 1 1 7] [ 2 6 8] [ 0 9 9] [ 1 55 5]] #eg1_2 a = [[1,2,0,1],[1,6,9,55],[7,8,9,5]] #a为列表 print(a.T) #Result: 'list' object has no attribute 'T'
更多Python相关技术文章,请访问Python教程栏目进行学习!
Copyright © 2019- 517ttc.cn 版权所有 赣ICP备2024042791号-8
违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务