摘要:
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 阅读全文
摘要:
it = np.nditer(x, flags=['multi_index'], op_flags=['readwrite']) while not it.finished: # ... it.iternext() np.nditer:有效的多维迭代器对象,可以遍历数组。 参数(部分): op:nd 阅读全文