text_html_output_1.png
import pandas as pd

import plotly.express as px

df = pd.read_csv('/kaggle/input/tomato-daily-prices/Tomato.csv')
backup = df.copy(deep=True)

import plotly.express as px
df['Year'] = df['Date'].dt.year
df['Month'] = df['Date'].dt.month
grouped = df.groupby(['Year', 'Month'])['Average'].mean().reset_index()
fig = px.line(grouped, x='Month', y='Average', color='Year', title='Monthly Tomato Price over Years', labels={'Month': 'Month', 'Weight': 'Mean Weight', 'Year': 'Year'})
fig.show()