导包
import pandas as pd
import numpy as np
import string
from pandas import DataFrame, Series
生成字典
dic = dict(zip(string.ascii_lowercase,string.digits))
dic
"""
{'a': '0',
'b': '1',
'c': '2',
'd': '3',
'e': '4',
'f': '5',
'g': '6',
'h': '7',
'i': '8',
'j': '9'}
"""
通过Series过度的方法,将dict变成DataFrame
result = DataFrame(Series(dic))
result
可重新定义:columns
result.columns = ['词出现的次数']
result