I have excel file shown bellow from that i need to extract data in different format using python. so please help i tried the bellow code:
import xlrd
book = xlrd.open_workbook("excel.xlsx")
sheet = book.sheet_by_index(0)
year=[]
# for print the year seperately in list.
for dat in sheet.row_values(0):
if dat is not '':
year.append(dat)
print(year)
rowdata = []
for i in range(2, sheet.nrows):
sheetinlist = sheet.row_values(i)
for cell in sheetinlist:
if cell is not '':
rowdata.append(cell)
print(rowdata)
I print all data without null with the above code Click to see but couldn't get desire output
the desire output should be in list like:[student age, 20, 1990], [student age, 21,1991], [student age, 22,1992],...... for whole sheet. using for loop.
The excel sheet is: click to see
So Please help ....Awaiting for response...