title: Calculate Monthly Average price and plot using Plotly
body: <p>I have a Dataframe which contains sold house prices in two areas over a daily period from Oct 2021 till today.</p>
  <p>I want to find the average house price per month and plot a graph using plotly to see if prices are going down or up in each area.</p>
  <p><strong>Sample DataFrame:</strong></p>
  <pre><code>DateSold            Price    Area
  12/10/2021 00:00    300000  Area A
  17/10/2021 00:00    350000  Area B
  18/10/2021 00:00    400000  Area B
  11/12/2021 00:00    412000  Area A
  17/12/2021 00:00    315000  Area A
  08/01/2022 00:00    385000  Area A
  09/01/2022 00:00    445000  Area A
  15/01/2022 00:00    309000  Area B
  15/01/2022 00:00    350000  Area B
  </code></pre>
  <p>I tried to convert the datetime column into a PeriodIndex on monthly frequency, then take the mean using GroupBy.mean:</p>
  <pre><code>df2.groupby(pd.PeriodIndex(df2['Datesold'], freq=&quot;M&quot;))['Price'].mean()
  </code></pre>
  <p>Can someone point me in the right direction in how I can achieve the average house price per month and plot that using plotly?</p>
  <p>I was using the below code for plotly</p>
  <pre><code>fig = px.line(df, x = df['DateSold'], y = df['Price'], title='Average sold house price
  </code></pre>