【发布时间】:2020-09-08 03:38:55
【问题描述】:
我在 python 中有一个名为word_counts 的字典,由关键词和值组成,代表它们在给定文本中出现的频率:
word_counts = {'the':2, 'cat':2, 'sat':1, 'with':1, 'other':1}
我现在需要把它变成一个带有两列的 pandas DataFrame:一个名为“word”的列表示单词,一个名为“count”的列表示频率。
【问题讨论】:
标签: python pandas dataframe dictionary