I have this function:
def get_starting_centroids(centroids,size,num):
for i in range(0,num):
temp = []
for j in range(0,size):
random.seed(time.clock())
g = random.random()
g = g*.85 + .15
print "random: %i" %g
temp.append(g)
centroids.append(temp)
return centroids
print tells me it always returns 0. If I test random.random() in the python prompt I get a random value. I don't understand what causes this difference
randomeach round?random.seed()(without parameters) uses the current system time by default anyway.seedinside the loop, you're not getting random numbers at all.