TypeError: list indices must be integers or slices, not str 정수? str? 잘 모르겠습니다.

조회수 1948회

TypeError: list indices must be integers or slices, not str 에러가 뜨는데 어떻게 해결해야될지 모르겠습니다, str 대신 int도 넣어봤는데 안되더라구요

//tsne = TSNE(random_state=0, n_iter=300, learning_rate=100)
X_tsne = tsne.fit_transform(X_sub)
plt.figure(figsize=(10, 10))
plt.xlim(X_tsne[:, 0].min(), X_tsne[:, 0].max() + 1)
plt.ylim(X_tsne[:, 1].min(), X_tsne[:, 1].max() + 1)
for i in range(len(X)):
    # 숫자 텍스트를 이용해 산점도를 그립니다
    plt.text(X_tsne[i, 0], X_tsne[i, 1], str(X.target[i]),
             color = colors[X.target[i]],
             fontdict={'weight': 'bold', 'size': 9})
plt.xlabel("t-SNE feature 0")
plt.xlabel("t-SNE feature 1")

답변을 하려면 로그인이 필요합니다.

프로그래머스 커뮤니티는 개발자들을 위한 Q&A 서비스입니다. 로그인해야 답변을 작성하실 수 있습니다.

(ಠ_ಠ)
(ಠ‿ಠ)