daily pastebin goal


a guest Jan 17th, 2018 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def XLSXDictReader(f):
  2.     book = openpyxl.reader.excel.load_workbook(f)
  3.     sheet = book.get_active_sheet()
  4.     rows = sheet.max_row
  5.     cols = sheet.max_column
  6.     headers = dict((i, sheet.cell(row=1, column=i).value) for i in range(1, cols))
  7.     def item(i, j):
  8.         return (sheet.cell(row=1, column=j).value, sheet.cell(row=i, column=j).value)
  9.     return (dict(item(i, j) for j in range(1, cols + 1)) for i in range(2, rows + 1))
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