2022.07.11 05:47 AM
This might not be directly relevant to kdb/q, as qpython is a third-party library. Let's say we have a QDictionary qdict in python. How can we send this dictionary to kdb?
https://qpython.readthedocs.io/en/latest/type-conversion.html#dictionaries
pseudo code:
qdict = QDictionary(qlist(numpy.array([1, 2], dtype=numpy.int64), qtype=QLONG_LIST), qlist(numpy.array(['abc', 'cdefgh']), qtype = QSYMBOL_LIST))
with qconnection.QConnection(host = 'localhost', port = 5000) as q:
q('mydict:', qdict)
2022.07.11 07:00 AM
You want to store it in a global variable in q?
Then you can use a lambda and ::
or set
q('{`mydict set x}', qdict)
q('{mydict::x}', qdict)
2022.07.11 07:00 AM
You want to store it in a global variable in q?
Then you can use a lambda and ::
or set
q('{`mydict set x}', qdict)
q('{mydict::x}', qdict)
2022.07.11 07:51 AM
Perfect, thanks!
EMEA
Tel: +44 (0)28 3025 2242
AMERICAS
Tel: +1 (212) 447 6700
APAC
Tel: +61 (0)2 9236 5700
KX. All Rights Reserved.
KX and kdb+ are registered trademarks of KX Systems, Inc., a subsidiary of FD Technologies plc.