I have a problem with importing data from the spreadsheet. I'm trying create list containing all data. But only last row is added to list.
from openpyxl import load_workbook
path = "excel.xlsx"
l_data = load_workbook(path)
sheet = l_data.active
c_row = sheet.max_row
c_column = sheet.max_column
out_data=[]
dict={}
for a in range(1, c_row + 1):
for b in range(1, c_column + 1):
ob = sheet.cell(row=a, column=b)
dict[b] = ob.value
out_data.append(dict)
I need such output data: [ {1:"row1_call1",2:"row1_call2"},{1:"row2_call1",2:"row2_call2"} ]