Python-Text-Analysis-Fundamentals icon indicating copy to clipboard operation
Python-Text-Analysis-Fundamentals copied to clipboard

Shape issue with cosine_similarity

Open EastBayEv opened this issue 4 years ago • 2 comments

Update print("Cosine similarity between first and second book:")

cosine_similarity needs updating

EastBayEv avatar Nov 18 '20 19:11 EastBayEv

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!

EastBayEv avatar Feb 11 '21 21:02 EastBayEv

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,:]])))

rbarreto avatar Feb 18 '21 17:02 rbarreto