Clustering, Segmentation, Data Science, Remote Sensing, Satellite.
centroids[i-1][1]-data.G, centroids[i-1][2]-data.B], axis=1) data[f'C{i}'] = merged.max(axis=1) cols.append(f'C{i}') data['Class'] = data[cols].abs().idxmin(axis=1) #assigning clusters to points return data #returning the dataframe with k cluster columns and one Class column with the final cluster