I need to sort the count of tokens in descending order, is there any other method than creating a dataframe? : token_map = {}
words = []

with open('test.csv', 'r') as fopen:
    lines = fopen.readlines()
    for line in lines:
        line = str.strip(line)
        words_in_line = str.split(line, " ")
        token_map[line] = "" + str(len(words_in_line)) +","+ str(len(line))
        words.append(words_in_line)


print words
print token_map




