簡體   English   中英

嘗試將數據集加載為Snap.py中的表時出現運行時錯誤

[英]Runtime error while trying to load a dataset as a table in Snap.py

我試圖從http://people.sc.fsu.edu/~jburkardt/datasets/cities/cities.html加載co04_dist.txt作為Snap.py中的表

import snap

context = snap.TTableContext()
filename = "co04_dist.txt"

schema = snap.Schema()
schema.Add(snap.TStrTAttrPr("Col1", snap.atInt))
schema.Add(snap.TStrTAttrPr("Col2", snap.atInt))
schema.Add(snap.TStrTAttrPr("Col3", snap.atInt))
schema.Add(snap.TStrTAttrPr("Col4", snap.atInt))

table = snap.TTable.LoadSS(schema, filename, context, "\t", snap.TBool(False))

但是我得到的只是運行時錯誤,聲稱應用程序以異常的方式請求運行時終止它。 它還在外殼中這樣說:

Traceback (most recent call last):
  File "C:\Users\User\Documents\city.py", line 12, in <module>
table = snap.TTable.LoadSS(schema, filename, context, "\t", snap.TBool(False))
  File "C:\Python27\lib\snap.py", line 23070, in LoadSS
return _snap.TTable_LoadSS(*args)
RuntimeError: Execution stopped: Ss.GetFlds() == S.Len(), file c:\cygwin\home\rok\build\snap\snap-core\table.cpp, line 683

我已經確保txt文件已經與.py文件位於同一目錄中。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM