Beispiel #1
0
    def _read_list(self, qtype):
        if self._options.pandas:
            self._options.numpy_temporals = True

        qlist = QReader._read_list(self, qtype=qtype)

        if self._options.pandas:
            atom_qtype = -abs(qtype)
            if atom_qtype not in [
                    QMONTH, QDATE, QDATETIME, QMINUTE, QSECOND, QTIME,
                    QTIMESTAMP, QTIMESPAN, QSYMBOL, QFLOAT, QDOUBLE, QGUID
            ]:
                null = QNULLMAP[atom_qtype][1]
                if atom_qtype in PANDAS_TYPE:
                    ps = pandas.Series(data=qlist,
                                       dtype=PANDAS_TYPE[atom_qtype]).replace(
                                           null, pandas.NA)
                else:
                    ps = pandas.Series(data=qlist).replace(null, pandas.NA)
            else:
                ps = pandas.Series(data=qlist)

            ps.meta = MetaData(qtype=qtype)
            return ps
        else:
            return qlist
Beispiel #2
0
 def _read_list(self, qtype):
     if qtype == QSYMBOL_LIST:
         self._buffer.skip()
         length = self._buffer.get_int()
         symbols = self._buffer.get_symbols(length)
         return [s.decode(self._encoding) for s in symbols]
     else:
         return QReader._read_list(self, qtype = qtype)
Beispiel #3
0
 def _read_list(self, qtype):
     if qtype == QSYMBOL_LIST:
         self._buffer.skip()
         length = self._buffer.get_int()
         symbols = self._buffer.get_symbols(length)
         return [s.decode(self._encoding) for s in symbols]
     else:
         return QReader._read_list(self, qtype=qtype)
Beispiel #4
0
    def _read_list(self, qtype, options):
        if options.pandas:
            options.numpy_temporals = True

        list = QReader._read_list(self, qtype = qtype, options = options)

        if options.pandas:
            if -abs(qtype) not in [QMONTH, QDATE, QDATETIME, QMINUTE, QSECOND, QTIME, QTIMESTAMP, QTIMESPAN, QSYMBOL]:
                null = QNULLMAP[-abs(qtype)][1]
                ps = pandas.Series(data = list).replace(null, numpy.NaN)
            else:
                ps = pandas.Series(data = list)

            ps.meta = MetaData(qtype = qtype)
            return ps
        else:
            return list
Beispiel #5
0
    def _read_list(self, qtype):
        if self._options.pandas:
            self._options.numpy_temporals = True

        qlist = QReader._read_list(self, qtype = qtype)

        if self._options.pandas:
            if -abs(qtype) not in [QMONTH, QDATE, QDATETIME, QMINUTE, QSECOND, QTIME, QTIMESTAMP, QTIMESPAN, QSYMBOL]:
                null = QNULLMAP[-abs(qtype)][1]
                ps = pandas.Series(data = qlist).replace(null, numpy.NaN)
            else:
                ps = pandas.Series(data = qlist)

            ps.meta = MetaData(qtype = qtype)
            return ps
        else:
            return qlist