Skip to content

PyKX conversion considerations

This page provides details on data types and conversions in PyKX.

PyKX attempts to make conversions between q and Python as seamless as possible. However due to differences in their underlying implementations there are cases where 1 to 1 mappings are not possible.

Data types and conversions

The key PyKX APIs around data types and conversions are outlined under:

Text representation in PyKX

Handling and converting text in PyKX requires consideration as there are some key differences between the Symbol and Char data types.

Nulls and Infinites

Most q datatypes have the concepts of null, negative infinity, and infinity. Python does not have the concept of infinites and it's null behaviour differs in implementation. The page handling nulls and infinities details the needed considerations when dealing with these special values.

Temporal data types

Converting temporal data types in PyKX involves handling timestamp/datetime types and duration types, each with specific considerations due to differences in how Python and q (the language used by kdb+) represent these data types.