#NEWLINE# def bmu_ind_to_xy( self , bmu_ind ) : #NEWLINE# #INDENT# '\n        Translates a best matching unit index to the corresponding matrix x,y coordinates\n\n        :param bmu_ind: node index of the best matching unit (number of node from top left node)\n        :returns: corresponding (x,y) coordinate\n        ' #NEWLINE# rows = self . codebook . mapsize [ 0 ] #NEWLINE# cols = self . codebook . mapsize [ 1 ] #NEWLINE# out = np . zeros ( ( bmu_ind . shape [ 0 ] , 3 ) ) #NEWLINE# out [ : , 2 ] = bmu_ind #NEWLINE# out [ : , 0 ] = ( ( rows - 1 ) - ( bmu_ind / cols ) ) #NEWLINE# out [ : , 0 ] = ( bmu_ind / cols ) #NEWLINE# out [ : , 1 ] = ( bmu_ind % cols ) #NEWLINE# return out . astype ( int )