是他们使用分块从数据库中获取数据的任何方式吗
我的数据库中有大约 3000 万个数据,如果不使用它,我会使用 pandas 0.17.1 版来导致大量内存使用
for sd in psql.read_sql(sql,myconn,chunksize=100):
print sd
但投掷
/usr/bin/python2.7 /home/subin/PythonIDE/workspace/python/pygram.py
Traceback (most recent call last):
File "/home/subin/PythonIDE/workspace/python/pygram.py", line 20, in <module>
for sd in psql.read_sql(sql,myconn,chunksize=100):
File "/usr/lib/python2.7/dist-packages/pandas/io/sql.py", line 1565, in _query_iterator
parse_dates=parse_dates)
File "/usr/lib/python2.7/dist-packages/pandas/io/sql.py", line 137, in _wrap_result
coerce_float=coerce_float)
File "/usr/lib/python2.7/dist-packages/pandas/core/frame.py", line 969, in from_records
coerce_float=coerce_float)
File "/usr/lib/python2.7/dist-packages/pandas/core/frame.py", line 5279, in _to_arrays
dtype=dtype)
File "/usr/lib/python2.7/dist-packages/pandas/core/frame.py", line 5357, in _list_to_arrays
content = list(lib.to_object_array_tuples(data).T)
TypeError: Argument 'rows' has incorrect type (expected list, got tuple)
请帮我