作者nnnnn (nnnnn)
看板Python
标题[问题] 用spyder开sas档出现错误
时间Sun Apr 2 11:02:53 2017
各位版上大大好:
因为有个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://webptt.com/cn.aspx?n=bbs/Python/M.1491102175.A.C48.html
1F:→ s860134: KeyboardInterrupt... 你按到 ctrl+c ? 04/02 12:18
2F:→ s860134: 通常程式逻辑不会特别发起这个 Excetion 04/02 12:19