I am new in python and I am trying to return the most 50 commons word's in a lyrics of songs and I have a problem that I don't really understand why it's happens.
the name "lyrics" in the code is a string of the song lyrics from a text file. every iteration of the loop is different string of lyrics that I need to include in the total of how much word are shows up in the songs.
if someone know where the problem is and can help it would be very nice.
my output is not with words is in characters: "[(' ', 46), ('o', 24), ('e', 23), ('n', 15), ('t', 15), ('h', 12), ('a', 12), ('w', 8), ('r', 8), ('s', 8), ('\n', 7), ('f', 7), ('d', 6), ('u', 5), ('y', 5), ('m', 5), ('I', 4)..." and i need to get something like: ("the", 555), ("you", 365)... without include white spaces and \n
count = {}
for songs in the_dict.values():
songs = songs[0]
for lyrics in songs.values():
lyrics = lyrics[2]
count = Counter(lyrics)
return count.most_common(50)