I am getting empty list in E-step

getting empty list in E-step while using dist.append(d)

Hey jatin,
The code in the videos is working perfectly fine.
Would you share you code so that i can look where is the mistake…

I would be waiting.
Thanks :slight_smile:

sure sir,

for i in range(X.shape[0]):
dist=[]
Xpts=X[i]
for k in range(k):
d=distance(X[i],clusters[k][‘centre’])
dist.append(d)

cluster_no=np.argmin(dist)
    
clusters[cluster_no]['points'].append(Xpts)

The function you have written is absolutely fine. but since you are still getting an empty list. Can you please put whole code on cb.lk/ide and send the link.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.