vault backup: 2024-03-16 17:51:42
This commit is contained in:
@@ -211,7 +211,6 @@ plt.show()
|
||||
|
||||

|
||||
|
||||
|
||||
## 业务区域分布
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
##
|
||||
Reference in New Issue
Block a user