@@ -22,14 +22,14 @@ to this table:
2222=============== ============ =====================================
2323 q type q num type Python type
2424=============== ============ =====================================
25- ``bool `` -1 ``numpy.bool_ ``
25+ ``bool `` -1 ``numpy.bool_ ``
2626 ``guid `` -2 ``UUID ``
27- ``byte `` -4 ``numpy.byte ``
28- ``short `` -5 ``numpy.int16 ``
29- ``integer `` -6 ``numpy.int32 ``
30- ``long `` -7 ``numpy.int64 ``
31- ``real `` -8 ``numpy.float32 ``
32- ``float `` -9 ``numpy.float64 ``
27+ ``byte `` -4 ``numpy.byte ``
28+ ``short `` -5 ``numpy.int16 ``
29+ ``integer `` -6 ``numpy.int32 ``
30+ ``long `` -7 ``numpy.int64 ``
31+ ``real `` -8 ``numpy.float32 ``
32+ ``float `` -9 ``numpy.float64 ``
3333 ``character `` -10 single element ``str ``
3434 ``timestamp `` -12 ``QTemporal numpy.datetime64 ns ``
3535 ``month `` -13 ``QTemporal numpy.datetime64 M ``
@@ -54,31 +54,35 @@ described in the table:
5454===================================== ================ ============
5555 Python type q type q num type
5656===================================== ================ ============
57- ``bool `` ``bool `` -1
58- --- ``byte `` -4
59- --- ``short `` -5
60- ``int `` ``int `` -6
61- ``long `` ``long `` -7
62- --- ``real `` -8
63- ``double `` ``float `` -9
64- ``numpy.bool `` ``bool `` -1
65- ``numpy.byte `` ``byte `` -4
66- ``numpy.int16 `` ``short `` -5
67- ``numpy.int32 `` ``int `` -6
68- ``numpy.int64 `` ``long `` -7
69- ``numpy.float32 `` ``real `` -8
70- ``numpy.float64 `` ``float `` -9
71- single element ``str `` ``character `` -10
72- ``QTemporal numpy.datetime64 ns `` ``timestamp `` -12
73- ``QTemporal numpy.datetime64 M `` ``month `` -13
74- ``QTemporal numpy.datetime64 D `` ``date `` -14
75- ``QTemporal numpy.datetime64 ms `` ``datetime `` -15
76- ``QTemporal numpy.timedelta64 ns `` ``timespan `` -16
77- ``QTemporal numpy.timedelta64 m `` ``minute `` -17
78- ``QTemporal numpy.timedelta64 s `` ``second `` -18
79- ``QTemporal numpy.timedelta64 ms `` ``time `` -19
57+ ``bool `` ``bool `` -1
58+ --- ``byte `` -4
59+ --- ``short `` -5
60+ ``int `` ``int `` -6
61+ ``long `` ``long `` -7
62+ --- ``real `` -8
63+ ``double `` ``float `` -9
64+ ``numpy.bool `` ``bool `` -1
65+ ``numpy.byte `` ``byte `` -4
66+ ``numpy.int16 `` ``short `` -5
67+ ``numpy.int32 `` ``int `` -6
68+ ``numpy.int64 `` ``long `` -7
69+ ``numpy.float32 `` ``real `` -8
70+ ``numpy.float64 `` ``float `` -9
71+ single element ``str `` ``character `` -10
72+ ``QTemporal numpy.datetime64 ns `` ``timestamp `` -12
73+ ``QTemporal numpy.datetime64 M `` ``month `` -13
74+ ``QTemporal numpy.datetime64 D `` ``date `` -14
75+ ``QTemporal numpy.datetime64 ms `` ``datetime `` -15
76+ ``QTemporal numpy.timedelta64 ns `` ``timespan `` -16
77+ ``QTemporal numpy.timedelta64 m `` ``minute `` -17
78+ ``QTemporal numpy.timedelta64 s `` ``second `` -18
79+ ``QTemporal numpy.timedelta64 ms `` ``time `` -19
8080===================================== ================ ============
8181
82+ .. note :: By default, single element strings are serialized as q characters.
83+ This setting can be modified (`single_char_strings = True `) and
84+ and single element strings are represented as q strings.
85+
8286
8387String and symbols
8488******************
@@ -98,6 +102,20 @@ apply:
98102 'quick brown fox jumps over a lazy dog'
99103
100104
105+ .. note :: By default, single element strings are serialized as q characters.
106+ This setting can be modified (`single_char_strings = True `) and
107+ and single element strings are represented as q strings.
108+
109+ ::
110+
111+ >>> # serialize single element strings as q characters
112+ >>> print(q.sync('{[x] type each x}', ['one', 'two', '3'], single_char_strings = False))
113+ [ 10, 10, -10]
114+
115+ >>> # serialize single element strings as q strings
116+ >>> print(q.sync('{[x] type each x}', ['one', 'two', '3'], single_char_strings = True))
117+ [10, 10, 10]
118+
101119
102120Lists
103121*****
@@ -350,22 +368,22 @@ Complete null mapping between q and Python is represented in the table:
350368============== ============== =======================
351369 ``bool `` ``0b `` ``_QNULL_BOOL ``
352370 ``guid `` ``0Ng `` ``_QNULL_GUID ``
353- ``byte `` ``0x00 `` ``_QNULL1 ``
354- ``short `` ``0Nh `` ``_QNULL2 ``
355- ``int `` ``0N `` ``_QNULL4 ``
356- ``long `` ``0Nj `` ``_QNULL8 ``
357- ``real `` ``0Ne `` ``_QNAN32 ``
358- ``float `` ``0n `` ``_QNAN64 ``
359- ``string `` ``" " `` ``' ' ``
371+ ``byte `` ``0x00 `` ``_QNULL1 ``
372+ ``short `` ``0Nh `` ``_QNULL2 ``
373+ ``int `` ``0N `` ``_QNULL4 ``
374+ ``long `` ``0Nj `` ``_QNULL8 ``
375+ ``real `` ``0Ne `` ``_QNAN32 ``
376+ ``float `` ``0n `` ``_QNAN64 ``
377+ ``string `` ``" " `` ``' ' ``
360378 ``symbol `` \` ``_QNULL_SYM ``
361- ``timestamp `` ``0Np `` ``_QNULL8 ``
362- ``month `` ``0Nm `` ``_QNULL4 ``
363- ``date `` ``0Nd `` ``_QNULL4 ``
364- ``datetime `` ``0Nz `` ``_QNAN64 ``
365- ``timespan `` ``0Nn `` ``_QNULL8 ``
366- ``minute `` ``0Nu `` ``_QNULL4 ``
367- ``second `` ``0Nv `` ``_QNULL4 ``
368- ``time `` ``0Nt `` ``_QNULL4 ``
379+ ``timestamp `` ``0Np `` ``_QNULL8 ``
380+ ``month `` ``0Nm `` ``_QNULL4 ``
381+ ``date `` ``0Nd `` ``_QNULL4 ``
382+ ``datetime `` ``0Nz `` ``_QNAN64 ``
383+ ``timespan `` ``0Nn `` ``_QNULL8 ``
384+ ``minute `` ``0Nu `` ``_QNULL4 ``
385+ ``second `` ``0Nv `` ``_QNULL4 ``
386+ ``time `` ``0Nt `` ``_QNULL4 ``
369387============== ============== =======================
370388
371389The :py:mod: `qtype ` provides two utility functions to work with null values:
0 commit comments