马甲1号 发表于 2014-11-4 23:31 
原来你要的是后面那个。。。那个其实都是些json,用循环搞不难。另外这个版本我在ubuntu上跑的,编码utf-8, ...
我刚才跑了你的程序一遍,出现了2个疑问。第一个是出现了2个failed,第二个是我改写你的写出路径,但是出错了,我想存到desktop上面。如下:
0
failed: 1
....
18
failed: 1
...
读出错误:
Traceback (most recent call last):
File "/Users/johnhenry/Desktop/new program2.py", line 25, in <module>
dataout.to_csv('/Users/johnhenry/Desktop/dataout.csv')
File "/Library/Python/2.7/site-packages/pandas-0.13.1_213_gc174c3d-py2.7-macosx-10.9-intel.egg/pandas/core/frame.py", line 1145, in to_csv
formatter.save()
File "/Library/Python/2.7/site-packages/pandas-0.13.1_213_gc174c3d-py2.7-macosx-10.9-intel.egg/pandas/core/format.py", line 1177, in save
self._save()
File "/Library/Python/2.7/site-packages/pandas-0.13.1_213_gc174c3d-py2.7-macosx-10.9-intel.egg/pandas/core/format.py", line 1269, in _save
self._save_header()
File "/Library/Python/2.7/site-packages/pandas-0.13.1_213_gc174c3d-py2.7-macosx-10.9-intel.egg/pandas/core/format.py", line 1265, in _save_header
writer.writerow(encoded_labels)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-3: ordinal not in range(128)