mario
March 18, 2024, 3:18am
1
https://learninghub.kx.com/forums/topic/how-to-convert-sym-columns-to-guid-or-to-original-data
I have schema like
([]time:timespan$();sym:
$();user_uuid:$();order_id:
long$();instrument:`$()) when I feed using qpython suddenly, the all symbol column convert to something like int, meanwhile original data for sym is uuid, user_uuid is uuid, instrument was string How to solve it using pykx?
Can you include some more code to explain what the issue is?
To create a symbol vector you are using:
`symbol$() but you should use:
`$() .i.e
q)order_histories:([]time:`timespan$();sym:`$();user_uuid:`$();order_id:`long$();instrument:`$()) q)order_histories time sym user_uuid order_id instrument -------------------------------------- Insert some data and set a port:
q)order_histories insert (2?.z.N;2?`6;2?`6;2?100000;2?`6) 0 1 q)order_histories time sym user_uuid order_id instrument ---------------------------------------------------------0D09:21:01.649029855 kfmohp kfhogj 81418 milgli 0D05:24:41.981647398 lkklco jecpae 75009 igfbag q)\p 5000
Query from PyKX
>>> import pykx as kx >>> conn('order_histories') pykx.Table(pykx.q(' time sym user_uuid order_id instrument --------------------------------------------------------- 0D09:21:01.649029855 kfmohp kfhogj 81418 milgli 0D05:24:41.981647398 lkklco jecpae 75009 igfbag ')) >>> conn('order_histories').pd() time sym user_uuid order_id instrument 0 0 days 09:21:01.649029855 kfmohp kfhogj 81418 milgli 1 0 days 05:24:41.981647398 lkklco jecpae 75009 igfbag
mario
March 20, 2024, 4:21pm
3
my all sym column got integer result with format
pykx.SymbolAtom(int value) then I am using py() still got int value
Can you share a small sample of your PyKX code which shows the issue?