我正在Windows 64上使用Python 3.8。
我使用PyPDF2查找字符串。我使用以下代码将这些值定义为字典:
keys=range(7)
values = (Docket, Date, CC, Owner, Scope, Crew, Additional)
dict_convert = dict(zip(keys,values))
print(dict_convert)
dict_convert打印在下面,并显示范围= 7(键0到6)
{0: '149623', 1: '21/10/19', 2: 'UTILITIES', 3: 'Camille .', 4: '008-lilyÞeld Rd-grove To Ryan-stop Slow-134-01, Rol_1268472_20190923-161408, ', 5: '5', 6: 'None'}
当我将其解析为Pandas DataFrame时,仅输出键0至4。有什么想法吗?预先感谢。
df = pd.DataFrame.from_dict(dict_convert, orient='index',dtype=None)
print(df.head())
0 153841
1 26/11/19
2 UTILITIES - 702008
3 Camille .
4 Rol_1300868_20191107-171403, 000-manning St-mo...