I have a pandas dataframe in the following format. I am trying to plot this data based on ClusterAssigned, with probably different colors for 0 and 1.
Distance ClusterAssigned23 135 120 1264 0830 0
I tried with this code but does not seem to yield perfect results.
groups = dfprintscatter.groupby('ClusterAssigned')import matplotlib.pyplot as pltfig, ax = plt.subplots()
ax.margins(0.05)
for name, group in groups:ax.plot(group.Distance, group.ClusterAssigned, marker='o', linestyle='', ms=5, label=name)
ax.legend()plt.show()