摘要: import numpy as np c=np.array([1,2,3]) d=np.array([[1,2,3],[4,5,6],[7,8,9]]) e=np.array([[[1,2,3],[4,5,6],[7,8,9]]]) c.ndim # 1 d.ndim # 2 e.ndim # 3 阅读全文
posted @ 2021-12-04 16:08 KYZH 阅读(192) 评论(0) 推荐(1) 编辑
摘要: it = np.nditer(x, flags=['multi_index'], op_flags=['readwrite']) while not it.finished: # ... it.iternext() np.nditer:有效的多维迭代器对象,可以遍历数组。 参数(部分): op:nd 阅读全文
posted @ 2021-12-04 16:02 KYZH 阅读(228) 评论(0) 推荐(0) 编辑