I am reading the excel file row by row,and using if condition i am displaying some rows in the file as array.
row =[]
loc = 'output.xlsx'
wb = xlrd.open_workbook(loc)
sheet = wb.sheet_by_index(0)
for i in range(1,sheet.nrows):
row = sheet.row_values(i)
if row[0] == "A":
print(row)
else:
print(row)
Actual Output:
[A,gbg,87,89][B,huj,90,65][C,gh,80,32]...[F,uhj,44,21]
Expected output:
[[A,gbg,87,89],[B,huj,90,65],[C,gh,80,32],[....],[....],[....],[F,uhj,44,21]]
Need to save list of array in single array Could anyone please guide me.