I need to write in excel, and I need to know, based on the correspondence between groups and names, where to write "x", so I need a structure in which I need to save the group name and the columns and rows of the corresponding answers
n1 - is on line 1 n2 - is on line 2
A (group name) - located in column 2 B (group name) - located in column 3 c - located on column 4 D - located in column 5
I have to establish correspondence between users and groups in the matrix and write in excel. Working data:
Groups = A,B,C, D,E, F ...
Name = N1,N2,N3,N4 .....
N1 => A, C,D, F
N2= B,C,D
N3= A, E, F
Expected Result:
A B C D E F
N1 x x x x
N2 x x x
N3 x x x
N1, N2, N3 - are on rows
A,B, c,D - are on columns
I need to write in excel, and I need to know, based on the correspondence between groups and names, where to write "x", so I need a structure in which I need to save the group name and the columns and rows of the corresponding answers
N1 - is on row 1
N2 - is on row 2
A(group name) - is on column 2
B(group name) - is on column 3
C is on column 4
D is on column 5
Example:
for N1 I need to write on (row1,col2), (row1,column4), (row1,column5), (row1,column7)
for N2 I need to write on (row2,col3), (row2,column4), (row2,column5)
for N3 I need to write on (row3,col2), (row1,column3), (row1,column6), (row1,column7)
, db/csv. , , , .
, . , x .
2 2 , .
for a in b
.....
if group_name not in groups_pos.items():
groups_pos[col_pos] = group_name
name_group[row_pos] = group_name
col_pos += 1
row_pos += 1
......
for col, value in groups_pos.items():
sheet.cell(row=1, column=2+col).value = value
for row, value_p in groups_pos.items():
sheet.cell(row=row, column=2+col).value = 'x'`