SHARE
TWEET

Untitled

a guest Oct 21st, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. wb = load_workbook('./salaries.xlsx')
  2. sheet = wb.get_sheet_by_name('Лист1')
  3. salaries = list()
  4.  
  5. for cellObj in sheet['B2':'H9']:
  6.     for cell in cellObj:
  7.         position = sheet[cell.column + '1'].value
  8.         area = sheet['A' + str(cell.row)].value
  9.         salaries.append([cell.value, area, position])
  10.  
  11. l = len(salaries)
  12. medianSalary = list()
  13. for i in range(0,l - 6,7):
  14.     city = salaries[i: i + 7]
  15.     city.sort(key = lambda item: item[0])
  16.     medianSalary.append([city[3][0], city[3][1]])
  17. print(medianSalary)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top