I need to create an interactive chart on python taking data from different sheets of an Excel file. I tried to create a for loop to take data from all the sheets automatically, but I manage to graph only data coming from the last sheet of the file. I also would like to create a legend with the names of the sheets where data come from. This is my code, can you help me improving it?
import openpyxl as xl
import os, os.path
import pandas as pd
import plotly.express as px
output_data2=r'C:\\Users\\Desktop\\Vibration data analysis'
wb=xl.load_workbook(os.path.join(output_data2, "RMS Comparison.xlsx"))
for sheet in wb.worksheets:
if sheet.title != 'Graph':
df = pd.read_excel(os.path.join(output_data2, "RMS Comparison.xlsx"),sheet_name=sheet.title)
fig = px.line(df, x='Unnamed: 0', y='Unnamed: 2')
fig.show()