我正在尝试将相同的信息分组并计数成一行:
#Functions
def postal_saude ():
global df, lista_solic
#List of solicitantes in Postal Saude
list_sol = [lista_solic["name1"], lista_solic["name2"]]
#filter Postal Saude Solicitantes
df = df[(df['Cliente']==lista_clientes["6"])
& (df['Nome do solicitante'].isin(list_sol))]
#Alphabetical order
df = df.sort_index(by=['Nome do solicitante', 'nomeCorrespondente'])
#Grouping data of column
grouping = df.groupby('Tipo do serviços');
print (grouping)
postal_saude()
当它到达df.groupby时,会引发一个错误
我尝试搜索相同的错误,但没有找到有效的答案来帮助我解决问题
请看一下关于Group By的文档
前一段摘自here
下面是一个简单的例子:
你明白了,你可以使用我提供的第一个链接从这里开始构建
相关问题 更多 >
编程相关推荐