2021年中国富翁分析5
作者:冯德平(山野雪人)
#富翁最多的前5个行业
#绘制饼图(甜甜圈图)
import pandas as pd
#import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
dataCN = pd.read_csv("D:\\temp\\dataCN1.csv") #读文件
#print(dataCN.head(10))
a = dataCN["Industry"].value_counts().head()
index = a.index
industries = a.values
custom_colors = ["skyblue", "yellowgreen", 'tomato', "blue", "red"]
plt.figure(figsize=(8, 8))
plt.pie(industries, labels=index, colors=custom_colors)
central_circle = plt.Circle((0, 0), 0.5, color='white')
fig = plt.gcf()
fig.gca().add_artist(central_circle)
plt.rc('font', size=12)
plt.title("Top 5 Industries with Most Number of Billionaires", fontsize=20)
plt.show()
print(a)
'''
Manufacturing 151
Technology 111
Healthcare 79
Real Estate 55
Food & Beverage 50
Name: Industry, dtype: int64
'''