KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums PyKX pykx is returning different output compared to embedQ Reply To: pykx is returning different output compared to embedQ

  • rocuinneagain

    Member
    July 11, 2024 at 1:26 pm

    See: Upgrading from embedPy – PyKX

    PyKX converts Python strings to q symbols which differs from embedPy

    q).pykx.eval["'hello'"]`
    `hello

    Pass your data back as Bytes for it to become q character vectors

    q)string_to_bytes:.pykx.eval["lambda x: bytes(x, 'utf-8')"]
    q)string_to_bytes[.pykx.eval["'hello'"]]`
    "hello"