0
respostas

Index out of range

Trecho do código:

cluster = list(projection_m[projection_m['song']== nome_musica]['cluster_pca'])[0]
musicas_recomendadas = projection_m[projection_m['cluster_pca']== cluster][[0, 1, 'song']]
x_musica = list(projection_m[projection_m['song']== nome_musica][0])[0]
y_musica = list(projection_m[projection_m['song']== nome_musica][1])[0]

Erro: cluster = list(projection_m[projection_m['song']== nome_musica]['cluster_pca'])[0] IndexError: list index out of range

Meu código completo: https://github.com/PedroLaraa/Recomendador-De-Musicas/blob/main/Source/main.py