vault backup: 2024-03-16 17:41:18

This commit is contained in:
2024-03-16 17:41:18 +08:00
parent 7c3c695a8e
commit 2ccc124845

View File

@@ -210,3 +210,31 @@ plt.show()
![image.png|600](https://image.kfdr.top/i/2024/03/16/65f5617bb2942.png)
![image.png|600](https://image.kfdr.top/i/2024/03/16/65f5625b9cac2.png)
## 业务区域分布
```python
import pandas as pd
import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif'] = ['Microsoft YaHei']
# Load the Excel file
data = pd.read_excel('E:/Projects/analyse/pythonProject/merged_data.xlsx')
# Correcting the approach based on the updated description for the '区域' column
# Update the DataFrame to reflect the correct column name and values for categorization
data['Regional Category'] = data['区域'].map({'市内': '省内', '广东省内': '省内', '国际': '省外', '港澳台': '省外', '广东省外': '省外'})
# Calculate the distribution of the new categories
regional_category_distribution = data['Regional Category'].value_counts()
# Generate a pie chart to show the updated regional distribution of the business
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()
```
![image.png|600](https://image.kfdr.top/i/2024/03/16/65f568159bb5c.png)