I'd like to read only the visible rows form an excel worksheet in python.
the input (excel sheet):
so when I filter for example:
as an output in python , I will get just the visible data (1 row) in this case.
here my code:
from openpyxl import load_workbook
wb = load_workbook(r'C:\Bureau\test\Data.xlsx')
ws = wb['workload']
# iterate over all the rows in the sheet
for row in ws:
if ws.row_dimensions[row[0].row].hidden == False:
for cell in row:
print(cell.value)
the code works but it gives results in this format:
but I want to have with a normal format like a table or dataframe.
Any suggestions?
Thank you for your help



visiblerows?