Hello. I need to group data by name, count it and make a pie chart of the percentage share of place names from a given among all names.
链接到我的excel文件:https://drive.google.com/file/d/1gw5mcu3mJXH0Gg4Q-PnRrxDMFq-6VvDo/view?usp=sharing
import pandas as pd
import xlrd
import matplotlib.pyplot as plt
data = pd.read_excel("table.xlsx", sheet_name=0)
data.groupby('Woj.')['Nazwa miejscowości'].unique().plot(kind='bar')
plt.show()
我不确定这是否是你问的,请让我知道以防万一。首先,我按名称分组,然后饼图显示每个名称的位数
输出:
相关问题 更多 >
编程相关推荐