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}
评论列表
文章目录