Пример #1
0
    def __bytes__(self):
        """
        Return a string representation for a particular DataFrame

        Invoked by bytes(df) in py3 only.
        Yields a bytestring in both py2/py3.
        """
        encoding = com.get_option("display.encoding")
        return self.__unicode__().encode(encoding, 'replace')
Пример #2
0
    def __bytes__(self):
        """
        Return a string representation for a particular DataFrame

        Invoked by bytes(df) in py3 only.
        Yields a bytestring in both py2/py3.
        """
        encoding = com.get_option("display.encoding")
        return self.__unicode__().encode(encoding, 'replace')
Пример #3
0
    def __repr__(self):
        base, mult = _gfc(self.freq)
        formatted = tslib.period_format(self.ordinal, base)
        freqstr = _freq_mod._reverse_period_code_map[base]

        if not py3compat.PY3:
            encoding = com.get_option("display.encoding")
            formatted = formatted.encode(encoding)

        return "Period('%s', '%s')" % (formatted, freqstr)
Пример #4
0
    def __repr__(self):
        base, mult = _gfc(self.freq)
        formatted = tslib.period_format(self.ordinal, base)
        freqstr = _freq_mod._reverse_period_code_map[base]

        if not compat.PY3:
            encoding = com.get_option("display.encoding")
            formatted = formatted.encode(encoding)

        return "Period('%s', '%s')" % (formatted, freqstr)
Пример #5
0
 def __bytes__(self):
     encoding = com.get_option('display.encoding')
     return self.__unicode__().encode(encoding, 'replace')
Пример #6
0
 def __bytes__(self):
     encoding = com.get_option('display.encoding')
     return self.__unicode__().encode(encoding, 'replace')
Пример #7
0
 def __bytes__(self):
     encoding = com.get_option("display.encoding")
     return self.__unicode__().encode(encoding, "replace")