Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
学ぶ Challenge: Visualize Product vs Region Sales | Automating Reports and Visual Insights
Python Automation for Reports and Visual Insights
セクション 1.  20
single

single

bookChallenge: Visualize Product vs Region Sales

メニューを表示するにはスワイプしてください

タスク

スワイプしてコーディングを開始

Create a function plot_product_region_sales(data) that accepts a DataFrame with product, region, and sales columns and returns a seaborn grouped bar chart comparing sales across regions.

  • Use sns.catplot() with kind="bar" to create the chart, with region on the x-axis, sales on the y-axis, and bars grouped by product using the hue parameter.
  • Set the x-axis label to "Region" and the y-axis label to "Sales Amount" using chart.set_axis_labels().
  • Add a legend with the title "Product" using chart.add_legend(title="Product").
  • Add a chart title that includes both the words "Product" and "Region" using chart.fig.suptitle().
  • Call plt.tight_layout() to adjust the layout.
  • Return the chart object at the end of the function.

解答

Switch to desktop実践的な練習のためにデスクトップに切り替える下記のオプションのいずれかを利用して、現在の場所から続行する
すべて明確でしたか?

どのように改善できますか?

フィードバックありがとうございます!

セクション 1.  20
single

single

AIに質問する

expand

AIに質問する

ChatGPT

何でも質問するか、提案された質問の1つを試してチャットを始めてください

some-alt