From 7c84299a15ba0f63e74d0f5a462505f919da873c Mon Sep 17 00:00:00 2001 From: kefandaoren Date: Sat, 16 Mar 2024 17:51:42 +0800 Subject: [PATCH] vault backup: 2024-03-16 17:51:42 --- Extras/Omnivore/数据处理过程.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Extras/Omnivore/数据处理过程.md b/Extras/Omnivore/数据处理过程.md index 2ca0a71e..36d53e7b 100644 --- a/Extras/Omnivore/数据处理过程.md +++ b/Extras/Omnivore/数据处理过程.md @@ -211,7 +211,6 @@ plt.show() ![image.png|600](https://image.kfdr.top/i/2024/03/16/65f5625b9cac2.png) - ## 业务区域分布 ```python @@ -234,7 +233,21 @@ regional_category_distribution = data['Regional Category'].value_counts() plt.figure(figsize=(8, 8)) plt.pie(regional_category_distribution, labels=regional_category_distribution.index, autopct='%1.1f%%', startangle=140, colors=['skyblue', 'orange']) plt.title('业务区域分布') +plt.show() + +# Next, group by the new regional category and sum the revenues +revenue_by_category = data.groupby('Regional Category')['总成交价'].sum() + +# For the pie chart, we can directly use the revenue_by_category Series +# The index of this Series will be the labels, and the values will be the sizes for each pie slice +plt.figure(figsize=(8, 8)) +plt.pie(revenue_by_category, labels=revenue_by_category.index, autopct='%1.1f%%', startangle=140, colors=['skyblue', 'orange']) +plt.title('营收贡献占比') plt.show() ``` ![image.png|600](https://image.kfdr.top/i/2024/03/16/65f568159bb5c.png) + +![image.png|600](https://image.kfdr.top/i/2024/03/16/65f569fe39e54.png) + +## \ No newline at end of file