http://www.zmonster.me/2016/02/25/creation-and-io-of-ndarray.html
1 2 3 4 5 6 7 8 9 |
import numpy as np x=[0,1] y=[2,3,4] z=[5,6,7,8] print np.meshgrid(x, y,z) |
这样出来的结果,y的元素个数决定0轴(最外层)的长度,x的元素个数决定1轴的长度,z的元素个数决定2轴的长度。
人生没有原因,闯出一路精彩
http://www.zmonster.me/2016/02/25/creation-and-io-of-ndarray.html
1 2 3 4 5 6 7 8 9 |
import numpy as np x=[0,1] y=[2,3,4] z=[5,6,7,8] print np.meshgrid(x, y,z) |
这样出来的结果,y的元素个数决定0轴(最外层)的长度,x的元素个数决定1轴的长度,z的元素个数决定2轴的长度。