摘要: for x in np.nditer(m): print(x) 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 >>> for x in np.nditer(m,order = 'C'):#遍历顺序 print(x) 0 1 2 3 4 5 6 7 8 9 10 11 12 13 ... 阅读全文
posted @ 2018-10-11 11:32 a-庄儿 阅读(116) 评论(0) 推荐(0) 编辑
摘要: >>> import numpy as np >>> m = np.arange(24) >>> m array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]) >>> m.shape (24,) >>> n = m.reshape(3... 阅读全文
posted @ 2018-10-11 11:15 a-庄儿 阅读(268) 评论(0) 推荐(0) 编辑
摘要: >>> import numpy as np >>> a = list(range(10,15)) >>> a [10, 11, 12, 13, 14] >>> b = np.arange(5) >>> b array([0, 1, 2, 3, 4]) >>> b.shape (5,) >>> b.dtype dtype('int32') >>> #定义多维数组,取数组元素 >>> c = np... 阅读全文
posted @ 2018-10-11 10:58 a-庄儿 阅读(582) 评论(0) 推荐(0) 编辑