Example #1
0
    def __repr__(self):
        """x.__repr__() <==> repr(x)
Calculates the repr representation, using masked for fill if it is enabled. 
Otherwise fill with fill value.
        """
        _names = self.dtype.names
        _dates = self._dates
        if numeric.size(_dates) > 2 and self._dates.isvalid():
            timestr = "[%s ... %s]" % (str(_dates[0]), str(_dates[-1]))
        else:
            timestr = str(_dates)
        fmt = "%%%is : %%s" % (max([len(n) for n in _names]) + 4,)
        reprstr = [fmt % (f, getattr(self, f)) for f in self.dtype.names]
        reprstr.insert(0, "multitimeseries(")
        reprstr.extend([fmt % ("dates", timestr), fmt % ("    fill_value", self._fill_value), "               )"])
        return str("\n".join(reprstr))