在 Python 中连接数组时遇到错误:
x = np.array([])
while condition:
% some processing
x = np.concatenate([x + new_x])
我得到的错误是:
----> 1 x = np.concatenate([x + new_x])
ValueError: operands could not be broadcast together with shapes (0) (6)
附带说明一下,这是在 Python 中增长numpy
数组的有效方法吗?