I can't determine why I am getting an index error for my scatterplot.
fig,ax=plt.subplots(figsize=(12,8))
colors=['b','r']
for i in [2,4]:
indices=np.where(benign_or_malignant==i)
ax.scatter(clump_thickness[indices],single_ep_cell_size[indices],
s=55,c=colors[i])
IndexError Traceback (most recent call last) in () 4 for i in [2,4]: 5 indices=np.where(benign_or_malignant==i) ----> 6 ax.scatter(clump_thickness[indices],single_ep_cell_size[indices], s=55,c=colors[i])
IndexError: list index out of range
The dataset is formated like so (ct=clump_thickness, secs=single_ep_cell_size, cl=clump benign(2) or malignant(4):
id ct secs cl<br>
1000025 5 2 2<br>
1002945 5 7 2<br>
1015425 3 2 2<br>
1016277 6 3 2<br>
1017023 4 2 2<br>
1017122 8 7 4<br>
1018099 1 2 2<br>
1018561 2 2 2<br>
1033078 4 2 2<br>
1035283 1 1 2<br>
1036172 2 2 2<br>
1041801 5 2 4<br>
As I understand it, it should plot clump thickness vs single ep cell size and color the points differently based on whether i = 2 or 4. Can someone point me in the right direction?
