I have a python dictionary with keys (0,1,2....n) with each key holding the location co-ordinates in a tuple such as
{0:(x1,y1), 1:(x2,y2), 2:(x3,y3), ....., n-1:(xn,yn)}
I want to create a multidimensional array like
coordinates= np.array([
[x1, y1],
[x2, y2],
...
[xn, yn]
])
I have tried using array = numpy.array(vehPositions.values()) but could not get the expected result.
numpy.array(vehPositions.values())work? Are the values in different order or wrong values?array(dict_values([(x1,y1),(x2,y2),...])). If i usearray(x), it returns me 'numpy.ndarray' object is not callable. If I doarray[x], it gives me too many indices for array