formatters.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:mizani 作者: has2k1 项目源码 文件源码
def __call__(self, x):
        """
        Format a sequence of inputs

        Parameters
        ----------
        x : array
            Input

        Return
        ------
        out : list
            List of strings.
        """
        # Formatter timezone
        if self.tz is None and len(x):
            tz = self.formatter.tz = x[0].tzinfo

            if not all(value.tzinfo == tz for value in x):
                msg = ("Dates have different time zones. "
                       "Choosen `{}` the time zone of the first date. "
                       "To use a different time zone, create a "
                       "formatter and pass the time zone.")
                warn(msg.format(tz.zone))

        # The formatter is tied to axes and takes
        # breaks in ordinal format.
        x = [date2num(val) for val in x]
        return _format(self.formatter, x)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号