http://stackoverflow.com/questions/26193386/numpy-zip-function
x=np.array([1,2,3])
y=np.array([11,22,33])
zip these into Numpy 2D coordinates arrays?
x1,x2,x3=zip(*(x,y)) #the result are of type list,not numpy arrays
x1 = np.asarray(x1) #convert to type of arrays
http://blog.youkuaiyun.com/yongh701/article/details/50283689
zip取各个list的第项,作为返回的二维数组的第x项中的一维数组中的元素。
其实zip还是反过来会这个二维数组操作,但要注意写成zip(*),表示这是一个zip的逆操作。
http://stackoverflow.com/questions/12744778/what-is-the-equivalent-of-zip-in-pythons-numpy
本文探讨了如何使用Python中的Numpy库与内置的zip函数来处理一维数组,并将其组合成二维坐标数组。通过实例展示了将两个一维Numpy数组打包成一个二维数组的过程,并解释了如何将zip函数的输出转换为Numpy数组形式。
2941

被折叠的 条评论
为什么被折叠?



