2018年5月6日

摘要: a = np.arange(12) b = a print (b is a) b.shape = 3,4 print (a.shape) print (id(a)) print (id(b)) >>> True (3, 4) 2052537612608 2052537612608 c = a.vie 阅读全文
posted @ 2018-05-06 20:10 muziyi 阅读(132) 评论(0) 推荐(0) 编辑
 
摘要: numpy.array 参数类型要一样,而list参数可以不同 import numpy vector=numpy.array([5,6,7,8,9]) matrix=numpy.array([[1,2,3],[2,3,4],[4,5,6]]) print(vector) print(matrix) print(vector.shape) print(matrix.shape) vector.d... 阅读全文
posted @ 2018-05-06 19:52 muziyi 阅读(660) 评论(0) 推荐(0) 编辑
 
摘要: names=['yangyuying','zilingxi','ziye','muziyi'] for name in names: print(name) >>> yangyuying zilingxi ziye muziyi i=0 while i>> 1 2 3 for i in range(5): print(i) >>> 0 1 2 3 4 actor=[[... 阅读全文
posted @ 2018-05-06 10:36 muziyi 阅读(131) 评论(0) 推荐(0) 编辑