I have .zip archive with filename.xlsx inside it and I want to parse Excel sheet line by line.
How to proper pass filename into pandas.read_excel in this case?
I tried:
import zipfile
import pandas
myzip=zipfile.ZipFile(filename.zip)
for fname in myzip.namelist():
with myzip.open(fname) as from_archive:
with pandas.read_excel(from_archive) as fin:
for line in fin:
....
but it doesn't seem to work, and the result was:
AttributeError: __exit__
myzipinstead of adding that as a comment.