I have a numpy with each row containing x, y pairs and I want to display a scatter plot without using a for loop so I used the following approach using pandas:
def visualize_k_means_output(self, centroids):
fig, ax = plt.subplots()
self.visualize_box_relative_sizes()
frame = pd.DataFrame(centroids, columns=['X', 'Y'])
ax.scatter(frame['X'], frame['Y'], marker='*', s=200, c='black')
The question is how to extract the first item as x and the second item as y without using a for loop for example:
ax.scatter(x=[item[0] for item in centroids], y=[item[1] for item in centroids], ...)