我关于StackOverflow的第一个问题。请善待我:)
您好,我刚刚开始了一个关于数据科学的小项目,我想通过matplot最终创建一个饼图,显示设备型号在网站总流量中的百分比(即30%的iPhone、20%的iPad、10%的Mac等)
useragent count
iPhone 11298
Mac 3206
iPad 627
SM-N960F 433
SM-N950F 430
... ...
K330 1
K220 1
SM-J737P 1
SM-J737T1 1
0PFJ50 1
[1991 rows x 2 columns]
从截图上看,有1991年的记录。 我正在准备用于绘图的数据,我只想显示前5个UserAgent(前4个是设备,前5个将标记为其他和剩余项目的总和)
预期输出如下所示:
useragent count
iPhone 11298
Mac 3206
iPad 627
SM-N960F 433
Others 9000
非常感谢你
使用:
编辑:
您可以尝试以下方法:
虽然我不能完全确定,但值得一试。我希望它能给你们一些想法
相关问题 更多 >
编程相关推荐