网站更新内容:请访问: https://bigdata.ministep.cn/

pandas打开加密的excel

pandas打开加密的excel

import pandas as  pd
import os  
import io
import datetime 
file_temp = io.BytesIO()
with open(io, "rb") as f:
    file = msoffcrypto.OfficeFile(f)
    file.load_key(password)
    file.decrypt(file_temp)
    #file.decrypt(open(path_new, 'wb'))
df = pd.read_excel(io=file_temp,sheet_name='每日数据',dtype='object')
print(df.head())

参考:

python - Pandas 如何读取加密的excel - SegmentFault 思否
使用Pandas读取加密的Excel文件-腾讯云开发者社区-腾讯云

posted @ 2023-07-06 21:33  ministep88  阅读(370)  评论(0编辑  收藏  举报
网站更新内容:请访问:https://bigdata.ministep.cn/