我想从 KDB 数据库中提取数据并放入数据框中。我的查询在 qpad 中运行良好,没有问题;只需要将它写入我的 Pandas 数据框中。我的代码:
from qpython import qconnection
# Create the connection and save the handle to a variable
q = qconnection.QConnection(host = 'wokplpaxvj003', port = 11503, username = 'pelucas', password = 'Dive2600', timeout = 3.0)
try:
# initialize connection
q.open()
print(q)
print('IPC version: %s. Is connected: %s' % (q.protocol_version, q.is_connected()))
df = q.sendSync('{select from quote_flat where date within (2019.08.14;2019.08.14), amendment_no = (max;amendment_no)fby quote_id}')
df.info()
finally:
q.close()
df.info()
它在加注时失败了,AttributeError: 'QLambda' object has no attribute 'info'
所以我猜跟注不成功。