I want to read just 10 lines from Excel files (xlsx) without loading the whole file at once, as it can't be done on one of my machines (low memory).
I tried using
import xlrd
import pandas as pd
def open_file(path):
xl = pd.ExcelFile(path)
reader = xl.parse(chunksize=1000)
for chunk in reader:
print(chunk)
It seems like the file is loaded first then divided into parts.
How to read only first lines?