I'm trying to append a one dimensional numpy array to a two dimensional, so the one dimensional one is inserted on the place of another x-value.
Example:
all_polys = [[5,6],[8,9]] (before the error down below there is nothing stored in it yet)
poly = [1,2]
Expected Result:
all_polys = [[5,6],[8,9],[1,2]]
My Code:
all_polys = numpy.array([[]])
poly = np.expand_dims(poly, axis=0)
print(poly)
print(all_polys)
all_polys = np.concatenate(all_polys, poly)
The Error:
TypeError: only integer scalar arrays can be converted to a scalar index
Print Output before error:
[['400' '815' '650' '815' '650' '745' '400' '745']] (poly with added dimension)
[] (all_polies)
This really frustrates me. What I am doing wrong? It must be a little detail I overlooked, I guess.
all_polysstart as a list[[5,6],[8,9], as an array,np.array([[5,6,8,9]]), or as this useless thingnp.array([[]])? Ispolya list[1,2]or an array,np.array([1,2])?