lazy_load
Function
Implements the lazy_load method of the LangChain base class to load and parse .xlsx and .xls files. By default, the first row is the column header, and the second row is the content in a sheet. The column headers and content are read row by row.
- The file must be in .xlsx or .xls format; otherwise, the parsing fails and an exception is thrown.
- The file must exist, the number of sheets in the file cannot exceed 1,000, and the file size cannot exceed 100 MB. Otherwise, the parsing fails and an empty iterator is returned.
- If the file is in .xlsx format, the file before decompression cannot exceed 100 MB and cannot be a ZIP bomb (for details, see BaseLoader). Otherwise, the parsing fails and an empty iterator is returned.
- By default, the first row is the column header, and the second row is the content in a sheet. If the number of rows in a sheet is less than two, the sheet is empty by default. If the number of rows in a single sheet exceeds 10,000 or the number of columns exceeds 1,000, an empty sheet is returned.
Prototype
def lazy_load()
Return Value
Data Type |
Description |
|---|---|
Iterator[Document] |
Iterator of the Document object in LangChain. |
Parent topic: ExcelLoader