i am stuck to visualize scatter plot, as i got this error message: TypeError: unhashable type: 'slice'
genre_color={'Animation': 'r', 'Horror': 'b', 'Thriller': 'y', 'Drama': 'm', 'Comedy': 'deeppink', 'Sci-Fi': 'gold', 'Western': 'orange', 'Adventure': 'g', 'Documentary': 'brown', 'Musical': 'indigo', 'Fantasy': 'yellow', 'Mystery': 'purple', 'Film-Noir': 'cyan', '(no genres listed)': 'coral', 'Action': 'teal', 'War': 'black', 'Romance': 'skyblue', 'Children': 'lime', 'Crime': 'darkgreen'}
def join_movieDataFrames(pcaDF, genreDF):
x_scaled = preprocessing.scale(pcaDF, with_std=False)
pca = decomposition.PCA(n_components=2)
df_trans = pd.DataFrame(pca.fit_transform(x_scaled),index=df_A.index)
x = pd.merge(df_trans, genreDF, on='movieId')
return plt.scatter(x[:,0],x[:,1],c=data['genre_color'])
(df_A, df_B) = construct_data('ratings.csv', 'movies.csv')
(exVar, df_T) = apply_pca(df_A, 2)
join_movieDataFrames(df_T, df_B)