2021-03-31
阅读量:
1167
python如何实现两列中行数据相同的次数统计
python如何实现两列中行数据相同的次数统计
解决:
import pandas as pd data = pd.read_excel('c:/users/用户/desktop/数据.xlsx') temp = [[name[0],name[1],len(group)] for name,group in data.groupby(['Origin','Destination'])] data_re = pd.DataFrame(temp,columns=['Origin','Destination','count'])






评论(0)


暂无数据
推荐帖子
0条评论
0条评论
0条评论