Hi im sure there is a much more efficient way of coding this, im primarily a java programmer but trying to help some one out with some basic python.
I need to have a 2D array which contains a set of random co-ordinates eg (2, 10). My initial thought was to create the array then fill it will smaller arrays containing the two co-ordinates.
import numpy
import random
a = numpy.zeros(10000).reshape(100, 100)
temp = []
for i in range(0,100):
for j in range(0,100):
temp.append(random.randint(0,100))
temp.append(random.randint(0,100))
a[i][j]=temp
print a
This produces the error ValueError: setting an array element with a sequence.
So whats the best way to go about solving this problem? Sorry for this hacked together code i've never really had to use python before!