xlsx2csv
xlsx2csv copied to clipboard
Function only reading filtered rows. How do I read all rows from a sheet?
Here is my code - filepath = os.path.join(FolderPath, FileName) a = load_workbook(filepath, read_only=True)
def read_excel_file(path: str, sheet_index: int) -> pd.DataFrame: buffer = StringIO() Xlsx2csv(path, outputencoding="utf8").convert(buffer,sheetid=sheet_index) buffer.seek(0) df = pd.read_csv(buffer) return df
dfinal=read_excel_file(filepath,a.index(a.get_sheet_by_name('Sheetname'))+1)