我试图保存数据帧以供以后在pandas中使用。 但是,我有以下错误。
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/source/Linux/pkg/python-2.7.3/lib/python2.7/site-packages/pandas-0.11.0-py2.7-linux-x86_64.egg/pandas/core/series.py", line 2881, in to_csv
encoding=encoding)
File "/source/Linux/pkg/python-2.7.3/lib/python2.7/site-packages/pandas-0.11.0-py2.7-linux-x86_64.egg/pandas/core/frame.py", line 1393, in to_csv
formatter.save()
File "/source/Linux/pkg/python-2.7.3/lib/python2.7/site-packages/pandas-0.11.0-py2.7-linux-x86_64.egg/pandas/core/format.py", line 963, in save
f.close()
IOError: [Errno 5] Input/output error
即使是简单的对象dataframe.save
, a = DataFrame({'a':[1,3,4],'b':[3,4,5]})
也会失败。
答案 0 :(得分:0)
不推荐使用select * from config where name='sugar_version';
+----------+---------------+-------+
| category | name | value |
+----------+---------------+-------+
| info | sugar_version | 6.4.5 |
+----------+---------------+-------+
1 row in set (0.00 sec)
cat config.php |grep sugar_version
'sugar_version' => '6.4.5',
方法。您应该save
代替我们。看起来你正在使用pandas 0.11,它已经很老了。最新版本是0.16。
您还可以考虑将其保存到csv或HDF5。
http://pandas.pydata.org/pandas-docs/stable/io.html