

rocuinneagain
Forum Replies Created
-
An upgrade removed JupyterQ/embedpy as PyKX can be configured to replace it now.
If you ‘git pull’ the project, or reopen the sandbox link from the course page, it should resolve its-self. The problem may be that the upstream changes can no longer be merged into your local copy so may need some manual intervention. A quick fix would be to move the existing course project (with your existing work) to the side by renaming it and then refetch the project with the sandbox linky as usual.
On a related note, for your own notebooks, select ‘Python 3 (ipykernel)’ as your kernel make the first cell contain:
#;.pykx.disableJupyter()
The second cell contain:
# https://code.kx.com/pykx/3.0/examples/jupyter-integration.html#q-first-mode import pykx as kx kx.util.jupyter_qfirst_enable()
Then it should behave just like the previous JupyterQ/embedpy kernel.
-
rocuinneagain
MemberApril 17, 2025 at 1:43 pm in reply to: Loading python library (embedPy) without restarting kdb/qUsing https://github.com/rianoc/qXML as an example details attached in image
-
This reply was modified 3 days, 6 hours ago by
rocuinneagain.
-
This reply was modified 3 days, 6 hours ago by
rocuinneagain.
-
This reply was modified 3 days, 6 hours ago by
rocuinneagain.
-
This reply was modified 3 days, 6 hours ago by
-
Printing the values being passed each time you can see a null 0N is passed for the first value of y
q)({-1 .Q.s1 (x;y;x~y);x~y}':) 1 1 1 2 2 3 4 5 5 5 6 6
(1;0N;0b)
(1;1;1b)
(1;1;1b)
(2;1;0b)
(2;2;1b)
(3;2;0b)
(4;3;0b)
(5;4;0b)
(5;5;1b)
(5;5;1b)
(6;5;0b)
(6;6;1b)
011010001101bWe can also we with prev and next that nulls are padded as needed:
q)prev 1 2 3
0N 1 2
q)next 1 2 3
2 3 0N -
rocuinneagain
MemberMarch 20, 2025 at 10:15 am in reply to: Assigning upd inside a function and replay TP logYes this is a scoping issue. upd in f is a local variable only. You can use set to assign the global variable from within a function.
students:([]id:`long$(); name:`symbol$()); f:{[x] `upd set insert; -11!`:tpLog }["foo"];
-
PyKX and q/kdb+ use the same license.
1. What command is giving you that error?
It suggests you are trying to install the license a second time.
2. What output do you see when you ‘import pykx’ in your python session?
-
rocuinneagain
MemberMarch 7, 2025 at 9:25 pm in reply to: library error on register licence and connecting on external port in azureThe error is from the kurl library under PyKX. It is not needed to use PyKX so you can ignore that warning. You can configure PyKX to not attempt to load kurl at all by setting the environment variable:
QARGS="--no-kurl"
-
This reply was modified 1 month, 1 week ago by
rocuinneagain.
-
This reply was modified 1 month, 1 week ago by
rocuinneagain.
-
This reply was modified 1 month, 1 week ago by
-
rocuinneagain
MemberFebruary 26, 2025 at 11:10 am in reply to: What is the implementation of the deprecated DateTime datatype?Datetime is an backed by an 8 byte float.
The sz column is correct at the top of the page for datetime:
https://code.kx.com/q/basics/datatypes/
The incorrect 4 byte reference will be removed:
https://github.com/KxSystems/docs/pull/359
-
This reply was modified 1 month, 3 weeks ago by
rocuinneagain.
-
This reply was modified 1 month, 3 weeks ago by
-
rocuinneagain
MemberFebruary 20, 2025 at 9:35 am in reply to: pykx DatetimeAtom,DateTimeVector how to create it ?Hi,
As the datetime type is deprecated PyKX does not have an implementation of a Python –> datetime conversion.
PyKX does not provide a rich interface for the q datetime type, as it is deprecated. Avoid using it whenever possible.
https://code.kx.com/pykx/3.1/api/pykx-q-data/wrappers.html#pykx.wrappers.DatetimeAtom
-
rocuinneagain
MemberFebruary 18, 2025 at 5:01 pm in reply to: Char datatype and Unicode? Can 8 bit charsThe unicode characters use more than a single byte
q)s:"tést" / Store text with unicode to variable q)s / Unicode bytes displayed "t\303\251st" q)count s / 2 bytes are used by é 5 q)-1 s; /Print to standard out presents the unicode characters again. tést
-
If you pad out t2 ensuring it has a row for every col1 value then you’ll get what you want:
q)t1:([] col1:`a`b`c`d;col2:1 2 3 8;col3:11 22 33 88) q)t2:([] col1:`a`a`b`c;col4:4 5 6 7;col5:44 55 66 77)
q)(t2 uj select distinct col1 from t1 where not col1 in t2`col1) lj `col1 xkey t1 col1 col4 col5 col2 col3 ------------------------ a 4 44 1 11 a 5 55 1 11 b 6 66 2 22 c 7 77 3 33 d 8 88
-
This reply was modified 2 months, 4 weeks ago by
rocuinneagain.
-
This reply was modified 2 months, 4 weeks ago by
rocuinneagain.
-
This reply was modified 2 months, 4 weeks ago by
rocuinneagain.
-
This reply was modified 2 months, 4 weeks ago by
-
rocuinneagain
MemberJanuary 10, 2025 at 10:35 am in reply to: Error when using in Jupyter : ”licence error: embedq”A PyKX enabled license must be used.
Issued from: https://kx.com/kdb-insights-personal-edition-license-download/
(Not from: https://kx.com/kdb-personal-edition-download/ )
-
rocuinneagain
MemberMarch 20, 2025 at 2:35 pm in reply to: Assigning upd inside a function and replay TP loghttps://code.kx.com/q/basics/syntax/#prefix-infix-postfix
Due to insert being a keyword in the language which can operate with infix notation .i.e
`table insert (1;`Foo)
The `upd set insert creates a composition rather than executing as you want</p><p><br></p><p>https://code.kx.com/q/ref/compose/#implicit-composition</p><p><br></p><pre>q)`upd set insert
k){$[@x;.[x;();:;y];-19!((,y),x)]}[`upd]insert<br>q)type[`upd set insert]
105hTo bypass this you can use either square or round brackets as follows:
{[x] set[`upd;insert];-11!`:tpLog}
{[x] `upd set (insert);-11!`:tpLog}:: when executed inside a function can also do global assignment but again needs brackets to execute as you wish:
https://code.kx.com/q/basics/syntax/#colon-colon
{[x] upd::(insert);-11!`:tpLog}
-
This reply was modified 1 month ago by
rocuinneagain.
-
This reply was modified 1 month ago by
rocuinneagain.
code.kx.com
Syntax | Basics | kdb+ and q documentation - kdb+ and q documentation
Syntax of the q programming language
-
This reply was modified 1 month ago by
-
I checked and if you previously registered for that type of licence and you request a new one before the previous is expired you will be sent the original license. When this one expires you can request a new one on the 18th which will be valid for a further 90 days.
-
What is the output of: kx.q.take(4,kx.q.z.l) ? Normally it should be issued with a longer duration.
-
Your license does not have a needed flag to enable PyKX.
Go to: https://kx.com/kdb-insights-sdk-personal-edition-download/
Download this new license and install it and this new license will work for kdb+ and PyKX for you.