xlsx2csv icon indicating copy to clipboard operation
xlsx2csv copied to clipboard

Function only reading filtered rows. How do I read all rows from a sheet?

Open abhi250372 opened this issue 3 years ago • 0 comments

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)

abhi250372 avatar Dec 21 '22 00:12 abhi250372