how to calculate centroid in python,"nx.mean(data[:, -3:], axis=0)"