Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wb = load_workbook('./salaries.xlsx')
- sheet = wb.get_sheet_by_name('Лист1')
- salaries = list()
- for cellObj in sheet['B2':'H9']:
- for cell in cellObj:
- position = sheet[cell.column + '1'].value
- area = sheet['A' + str(cell.row)].value
- salaries.append([cell.value, area, position])
- l = len(salaries)
- medianSalary = list()
- for i in range(0,l - 6,7):
- city = salaries[i: i + 7]
- city.sort(key = lambda item: item[0])
- medianSalary.append([city[3][0], city[3][1]])
- print(medianSalary)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement