matrix.py 文件源码

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

项目:django-radar 作者: chairco 项目源码 文件源码
def matrix_data(self, Column=None):
        data = self.sequence_data
        header = self._header_matrix_mapping(column=data)
        coordinate = self.coordinate
        row_start_point = coordinate['row_start_point']
        col_title_length = coordinate['col_title_length']
        if Column is None:
            self.Column = []
        else:
            self.Column = Column

        title, comp = '', ''
        for row in trange(len(data), desc='matrix rows in memory'):
            if row > row_start_point:
                if data[row][header[self.item]] == None or data[row][header[self.item]] == '':
                    Rows, config = {}, ''
                    for cell in trange(len(data[row]), desc='matrix cols in memory', leave=False):
                        if cell < col_title_length:
                            Rows[cell] = data[row][cell]
                        if cell >= col_title_length and str(data[row][cell]).lower() != self.tip:
                            config += data[coordinate['row_start_point']][cell] + ';'
                        # title
                        if cell == header[self.item]:
                            Rows[cell] = title
                        # component
                        if cell == header[self.component]:
                            if data[row][header[self.component]] == None or data[row][header[self.component]] == '':
                                Rows[cell] = comp
                            else:
                                comp = data[row][header[self.component]]
                    Rows[col_title_length] = config
                    self.Column.append(Rows)
                else:
                    title = data[row][header[self.item]]
        return {'title': header, 'data': self.Column}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号