Python-Text-Analysis-Fundamentals
Python-Text-Analysis-Fundamentals copied to clipboard
Shape issue with cosine_similarity
Update print("Cosine similarity between first and second book:")
cosine_similarity needs updating
Hi @Akesari12 -- Can you commit and push these changes? Please close this comment when you are done. Let me know if you have any questions. Thanks!
solution: You could actually just use your original code and just add these brackets!
print("Cosine similarity between first and second book: " + str(cosine_similarity([dtm.iloc[0,:]], [dtm.iloc[1,:]])))