list - ay Array in python not getting updated -


following code in caller called first module, centroids of float type (an array of numberofcluster * numberoffeatures) labels 1d array of numberofexplanations

array not getting updated

def caller(centroids, labels):      number_of_features = len(centroids[0])     one_column = [0, 0, 0, 0, 0]      = 0     j = 0      array = [[0 x in xrange(number_of_features)] x in xrange(5)]      while < number_of_features:         j = 0         while j < 5:             one_column[j] = centroids[j][i]             j += 1          rank(one_column, i, array)         += 1        return calculatemean(number_of_features, array)   def rank(one_column, ithfeature, array):      temp_dict = {}     = 0     while < 5:          temp_dict[one_column[i]] =          += 1      number_of_uniquevalues = len(set(temp_dict))     sorted_dict = ordereddict(sorted(temp_dict.items()))      = 0     keys_list = sorted_dict.keys()      while < 5:         array[one_column.index(keys_list[i])][ithfeature] = sorted_dict[keys_list[i]]         += 1 

i have referred link

two dimensional array in python

and issue resolved


Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -