@@ -54,9 +54,9 @@ def raw(self, idx):
5454 index.
5555
5656 >>> t = qlist(numpy.array([366, 121, qnull(QDATE)]), qtype=QDATE_LIST)
57- >>> print t[0]
57+ >>> print( t[0])
5858 2001-01-01 [metadata(qtype=-14)]
59- >>> print t.raw(0)
59+ >>> print( t.raw(0) )
6060 366
6161
6262 :Parameters:
@@ -121,31 +121,31 @@ def qlist(array, adjust_dtype = True, **meta):
121121 - `byte numpy.array`:
122122
123123 >>> v = qlist(numpy.array([0x01, 0x02, 0xff], dtype=numpy.byte))
124- >>> print '%s dtype: %s qtype: %d: %s' % (type(v), v.dtype, v.meta.qtype, v)
124+ >>> print( '%s dtype: %s qtype: %d: %s' % (type(v), v.dtype, v.meta.qtype, v) )
125125 <class 'qpython.qcollection.QList'> dtype: int8 qtype: -4: [ 1 2 -1]
126126
127127 - `int32 numpy.array` with explicit conversion to `QBYTE_LIST`:
128128
129129 >>> v = qlist(numpy.array([1, 2, -1]), qtype = QBYTE_LIST)
130- >>> print '%s dtype: %s qtype: %d: %s' % (type(v), v.dtype, v.meta.qtype, v)
130+ >>> print( '%s dtype: %s qtype: %d: %s' % (type(v), v.dtype, v.meta.qtype, v) )
131131 <class 'qpython.qcollection.QList'> dtype: int8 qtype: -4: [ 1 2 -1]
132132
133133 - plain Python `integer` list with explicit conversion to `QBYTE_LIST`:
134134
135135 >>> v = qlist([1, 2, -1], qtype = QBYTE_LIST)
136- >>> print '%s dtype: %s qtype: %d: %s' % (type(v), v.dtype, v.meta.qtype, v)
136+ >>> print( '%s dtype: %s qtype: %d: %s' % (type(v), v.dtype, v.meta.qtype, v) )
137137 <class 'qpython.qcollection.QList'> dtype: int8 qtype: -4: [ 1 2 -1]
138138
139139 - numpy datetime64 array with implicit conversion to `QDATE_LIST`:
140140
141141 >>> v = qlist(numpy.array([numpy.datetime64('2001-01-01'), numpy.datetime64('2000-05-01'), numpy.datetime64('NaT')], dtype='datetime64[D]'))
142- >>> print '%s dtype: %s qtype: %d: %s' % (type(v), v.dtype, v.meta.qtype, v)
142+ >>> print( '%s dtype: %s qtype: %d: %s' % (type(v), v.dtype, v.meta.qtype, v) )
143143 <class 'qpython.qcollection.QList'> dtype: datetime64[D] qtype: -14: ['2001-01-01' '2000-05-01' 'NaT']
144144
145145 - numpy datetime64 array with explicit conversion to `QDATE_LIST`:
146146
147147 >>> v = qlist(numpy.array([numpy.datetime64('2001-01-01'), numpy.datetime64('2000-05-01'), numpy.datetime64('NaT')], dtype='datetime64[D]'), qtype = QDATE_LIST)
148- >>> print '%s dtype: %s qtype: %d: %s' % (type(v), v.dtype, v.meta.qtype, v)
148+ >>> print( '%s dtype: %s qtype: %d: %s' % (type(v), v.dtype, v.meta.qtype, v) )
149149 <class 'qpython.qcollection.QList'> dtype: datetime64[D] qtype: -14: ['2001-01-01' '2000-05-01' 'NaT']
150150
151151
@@ -171,7 +171,7 @@ def qlist(array, adjust_dtype = True, **meta):
171171 for i in xrange (len (array )):
172172 tarray [i ] = array [i ]
173173 array = tarray
174- else :
174+ else :
175175 array = numpy .array (array )
176176
177177 if not isinstance (array , numpy .ndarray ):
@@ -203,13 +203,13 @@ class QDictionary(object):
203203 Dictionary examples:
204204
205205 >>> # q: 1 2!`abc`cdefgh
206- >>> print QDictionary(qlist(numpy.array([1, 2], dtype=numpy.int64), qtype=QLONG_LIST),
207- ... qlist(numpy.array(['abc', 'cdefgh']), qtype = QSYMBOL_LIST))
206+ >>> print( QDictionary(qlist(numpy.array([1, 2], dtype=numpy.int64), qtype=QLONG_LIST),
207+ ... qlist(numpy.array(['abc', 'cdefgh']), qtype = QSYMBOL_LIST) ))
208208 [1 2]!['abc' 'cdefgh']
209209
210210 >>> # q: (1;2h;3.234;"4")!(`one;2 3;"456";(7;8 9))
211- >>> print QDictionary([numpy.int64(1), numpy.int16(2), numpy.float64(3.234), '4'],
212- ... [numpy.string_('one'), qlist(numpy.array([2, 3]), qtype=QLONG_LIST), '456', [numpy.int64(7), qlist(numpy.array([8, 9]), qtype=QLONG_LIST)]])
211+ >>> print( QDictionary([numpy.int64(1), numpy.int16(2), numpy.float64(3.234), '4'],
212+ ... [numpy.string_('one'), qlist(numpy.array([2, 3]), qtype=QLONG_LIST), '456', [numpy.int64(7), qlist(numpy.array([8, 9]), qtype=QLONG_LIST)]]) )
213213 [1, 2, 3.234, '4']!['one', QList([2, 3], dtype=int64), '456', [7, QList([8, 9], dtype=int64)]]
214214
215215 :Parameters:
@@ -320,22 +320,22 @@ def qtable(columns, data, **meta):
320320 >>> t = qtable(qlist(numpy.array(['name', 'iq']), qtype = QSYMBOL_LIST),
321321 ... [qlist(numpy.array(['Dent', 'Beeblebrox', 'Prefect'])),
322322 ... qlist(numpy.array([98, 42, 126], dtype=numpy.int64))])
323- >>> print '%s dtype: %s meta: %s: %s' % (type(t), t.dtype, t.meta, t)
323+ >>> print( '%s dtype: %s meta: %s: %s' % (type(t), t.dtype, t.meta, t) )
324324 <class 'qpython.qcollection.QTable'> dtype: [('name', 'S10'), ('iq', '<i8')] meta: metadata(iq=-7, qtype=98, name=-11): [('Dent', 98L) ('Beeblebrox', 42L) ('Prefect', 126L)]
325325
326326 >>> # q: flip `name`iq!(`Dent`Beeblebrox`Prefect;98 42 126)
327327 >>> t = qtable(qlist(numpy.array(['name', 'iq']), qtype = QSYMBOL_LIST),
328328 ... [qlist(['Dent', 'Beeblebrox', 'Prefect'], qtype = QSYMBOL_LIST),
329329 ... qlist([98, 42, 126], qtype = QLONG_LIST)])
330- >>> print '%s dtype: %s meta: %s: %s' % (type(t), t.dtype, t.meta, t)
330+ >>> print( '%s dtype: %s meta: %s: %s' % (type(t), t.dtype, t.meta, t) )
331331 <class 'qpython.qcollection.QTable'> dtype: [('name', 'S10'), ('iq', '<i8')] meta: metadata(iq=-7, qtype=98, name=-11): [('Dent', 98L) ('Beeblebrox', 42L) ('Prefect', 126L)]
332332
333333 >>> # q: flip `name`iq!(`Dent`Beeblebrox`Prefect;98 42 126)
334334 >>> t = qtable(['name', 'iq'],
335335 ... [['Dent', 'Beeblebrox', 'Prefect'],
336336 ... [98, 42, 126]],
337337 ... name = QSYMBOL, iq = QLONG)
338- >>> print '%s dtype: %s meta: %s: %s' % (type(t), t.dtype, t.meta, t)
338+ >>> print( '%s dtype: %s meta: %s: %s' % (type(t), t.dtype, t.meta, t) )
339339 <class 'qpython.qcollection.QTable'> dtype: [('name', 'S10'), ('iq', '<i8')] meta: metadata(iq=-7, qtype=98, name=-11): [('Dent', 98L) ('Beeblebrox', 42L) ('Prefect', 126L)]
340340
341341 >>> # q: flip `name`iq`fullname!(`Dent`Beeblebrox`Prefect;98 42 126;("Arthur Dent"; "Zaphod Beeblebrox"; "Ford Prefect"))
@@ -377,7 +377,7 @@ def qtable(columns, data, **meta):
377377 data [i ] = qlist (data [i ], qtype = QGENERAL_LIST )
378378 else :
379379 data [i ] = qlist (data [i ])
380-
380+
381381 meta [columns [i ]] = data [i ].meta .qtype
382382 dtypes .append ((columns [i ], data [i ].dtype ))
383383
@@ -403,9 +403,9 @@ class QKeyedTable(object):
403403 ... qtable(['pos', 'dates'],
404404 ... [qlist(numpy.array(['d1', 'd2', 'd3']), qtype = QSYMBOL_LIST),
405405 ... qlist(numpy.array([366, 121, qnull(QDATE)]), qtype = QDATE_LIST)]))
406- >>> print '%s: %s' % (type(t), t)
407- >>> print '%s dtype: %s meta: %s' % (type(t.keys), t.keys.dtype, t.keys.meta)
408- >>> print '%s dtype: %s meta: %s' % (type(t.values), t.values.dtype, t.values.meta)
406+ >>> print( '%s: %s' % (type(t), t) )
407+ >>> print( '%s dtype: %s meta: %s' % (type(t.keys), t.keys.dtype, t.keys.meta) )
408+ >>> print( '%s dtype: %s meta: %s' % (type(t.values), t.values.dtype, t.values.meta) )
409409 <class 'qpython.qcollection.QKeyedTable'>: [(1001L,) (1002L,) (1003L,)]![('d1', 366) ('d2', 121) ('d3', -2147483648)]
410410 <class 'qpython.qcollection.QTable'> dtype: [('eid', '<i8')] meta: metadata(qtype=98, eid=-7)
411411 <class 'qpython.qcollection.QTable'> dtype: [('pos', 'S2'), ('dates', '<i4')] meta: metadata(dates=-14, qtype=98, pos=-11)
0 commit comments