Skip to content

Instantly share code, notes, and snippets.

View chaconnewu's full-sized avatar

Yu Wu chaconnewu

  • Google
  • Mountain View
View GitHub Profile
@chaconnewu
chaconnewu / xlsx_reader.py
Created June 22, 2018 16:22
Excel XLSX DictReader in Python 3
import xlrd, mmap
def XLSDictReader(filename, sheet_index=0):
'''
Excel xlsd dict reader.
'''
with open(filename) as f:
book = xlrd.open_workbook(
file_contents=mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ))