[問題] 用spyder開sas檔出現錯誤
各位版上大大好:
因為有個sas7bdat需要用python開啟,環境用spyder
已經載好sas7bdat套件,但輸入程式碼
from sas7bdat import SAS7BDAT
with SAS7BDAT('log.sas7bdat') as f:
for row in f:
row
出現錯誤訊息:
File "<ipython-input-10-b6a4c2faab80>", line 1, in <module>
runfile('C:/Users/python/.spyder-py3/temp.py', wdir='C:/Users/ python
/.spyder-py3')
File "C:\Users\ python
\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 866,
in runfile
execfile(filename, namespace)
File "C:\Users\ python
\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102,
in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "C:/Users/ python /.spyder-py3/temp.py", line 3, in <module>
for row in f:
File "C:\Users\ python \Anaconda3\lib\site-packages\sas7bdat.py", line 620,
in readlines
current_subheader_pointer.length
File "C:\Users\ python \Anaconda3\lib\site-packages\sas7bdat.py", line
1185, in process_subheader
offset, length
File "C:\Users\ python \Anaconda3\lib\site-packages\sas7bdat.py", line 703,
in _process_byte_array_with_data
self.cached_page
File "C:\Users\ python \Anaconda3\lib\site-packages\sas7bdat.py", line 131,
in decompress_row
result.append(c(0x20))
KeyboardInterrupt
以上,google完相關資訊,猜測有可能是原始檔到不知道第幾筆後data有問題
[KeyboardInterrupt]的意思”鍵盤中斷向量”
想請問各位版上大大程式碼該怎麼修改會比較好?
非資工背景 找過網路文章也無法解決...感謝各位大大開示><
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 150.129.73.46
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1491102175.A.C48.html
→
04/02 12:18, , 1F
04/02 12:18, 1F
→
04/02 12:19, , 2F
04/02 12:19, 2F
Python 近期熱門文章
PTT數位生活區 即時熱門文章