numpy append_field gives shape error for new field with 2d shape
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a structured numpy array, I want to use the recfunctions library http://pyopengl.sourceforge.net/pydoc/numpy.lib.recfunctions.html function append_fields() or rec_append_fields() to append a field with some shape to it. However, I get an error: ValueError: operands could not be broadcast together with shapes (10) (10,3) where 10 is the length of my existing array, and (3,) is the shape of the field I want to append. For example: import numpy as np from numpy.lib.recfunctions import append_fields my_structured_array = np.array( zip([0