I have a pandas data frame of two columns ['frequency','color'] and it looks like this:
name frequency color
0 351 r
1 122 r
2 30 g
3 85 r
4 195 r
5 88 g
6 130 r
7 85 r
8 41 r
9 9 g
I want to plot the 'frequency' sorted and depending on the colors. I tried this:
plt.scatter(y=np.sort(data['frequency']),x=range(len(data['frequency'])),c=np.sort(data['color']))
and i got the following error:
ValueError: to_rgba: Invalid rgba arg "['r']" to_rgb: Invalid rgb arg "('r',)" sequence length is 1; must be 3 or 4
what is wrong in the code?
