arraywidget.py 文件源码

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

项目:larray-editor 作者: larray-project 项目源码 文件源码
def set_format(self, data, digits, scientific):
        """data: object with a dtype attribute"""
        type = data.dtype.type
        if type in (np.str, np.str_, np.bool_, np.bool, np.object_):
            fmt = '%s'
        else:
            # XXX: use self.digits_spinbox.getValue() and instead?
            # XXX: use self.digits_spinbox.getValue() instead?
            format_letter = 'e' if scientific else 'f'
            fmt = '%%.%d%s' % (digits, format_letter)
        # this does not call model_data.reset() so it should be called by the caller
        self.model_data._set_format(fmt)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号