LoslegenKostenlos loslegen

Fixing a Plotly figure

Your colleague started a project to create a visualization of sales for the first three months of 2025. However, she then left for some annual leave—but the boss wants the visualization now!

You can see she left behind a dictionary object that has started to define the visualization. It is your task to finish this dictionary with the important key arguments to turn it into a Plotly visualization.

plotly.express as px and monthly_sales DataFrame have already been loaded for you.

Diese Übung ist Teil des Kurses

Introduction to Data Visualization with Plotly in Python

Kurs anzeigen

Anleitung zur Übung

  • Define x_column and y_column using the "month" and "sales" columns.
  • Set chart_title to "Sales for Jan-Mar 2025".
  • Create a bar plot using these variables.

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Define the x and y axis columns
x_column = "____"
y_column = "____"

# Define the chart title
chart_title = ____

# Create a bar plot
fig = px.____(
    data_frame=monthly_sales, x=____, y=____, title=____)

fig.show()
Code bearbeiten und ausführen