Problem with data analyst project (project 4: time_series_visualizer

I have been trying to rum my code. However, I do not know where I am wrong. Could you help me show the way to correct it, please? The problem lies in the third plot.
here is my code:

import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from pandas.plotting import register_matplotlib_converters

# Import data (Make sure to parse dates. Consider setting index column to 'date'.)
data= pd.read_csv('fcc-forum-pageviews.csv', parse_dates= ['date'], index_col='date')

# Clean data
df = data= data[(data['value']>= data['value'].quantile(0.025))&
           (data['value']<= data['value'].quantile(0.975))]

def draw_line_plot():
  fig,ax = plt.subplots(figsize=(8,5))
  ax.plot(data.index, data['value'], 'r', linewidth=1)

  ax.set_ylabel('Page Views')
  ax.set_title('Daily freeCodeCamp Forum Page Views 5/2016-12/2019')  # Draw line plot

    # Save image and return fig (don't change this part)
  return fig

def draw_bar_plot():
    # Copy and modify data for monthly bar plot
  df= data.copy()

    # Draw bar plot, figsize=(10,5), ylabel='Average Page Views', xlabel='Years').figure


    # Save image and return fig (don't change this part)
  return fig

def draw_box_plot():
    # Prepare data for box plots (this part is done!)
  df_box = df.copy()
  df_box['year'] = [d.year for d in]
  df_box['month'] = [d.strftime('%b') for d in]

    # Draw box plots (using Seaborn)
  df_box["month_num"]= df_box["date"].dt.month
  df_box= df_box.sort_values("month_num")

  fig, axes = plt.subplots(nrows=1, ncols=2, figsize=(10,5))
  axes[0]= sns.boxplot(x=df_box["year"], y= df_box["value"],ax= axes[0])
  axes[1]= sns.boxplot(x=df_box["month"], y= df_box["value"],ax= axes[1])
  axes[0].set_title("Year-wise Box Plot (Trend)")
  axes[0].set_ylabel("Page Views")

  axes[1].set_title("Month-wise Box Plot (Seasonality)")
  axes[1].set_ylabel("Page Views")

    # Save image and return fig (don't change this part)
  return fig

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

Please provide a link to your project - without seeing the error message we cannot guess what might be causing any issues.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.