加入收藏 | 设为首页 | 会员中心 | 我要投稿 核心网 (https://www.hxwgxz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 教程 > 正文

Python数据可视化:Python大佬有哪些?

发布时间:2018-12-01 02:27:56 所属栏目:教程 来源:法纳斯特
导读:有态度地学习 之前讲了代理池以及Cookies的相关知识,这里针对搜狗搜索微信公众号文章的爬取,将它俩实践一下。 在崔大的书里面,他是用代理IP来应对搜狗的反爬措施,因为同一IP访问网页过于频繁,就会跳转验证码页面。 不过时代在进步,搜狗搜索的反爬也

最后成功获取数据。

Python数据可视化:Python大佬有哪些?

Python数据可视化:Python大佬有哪些?

04 数据可视化

1 微信文章发布数量TOP10

Python数据可视化:Python大佬有哪些?

这里对搜索过来的微信文章进行排序,发现了这十位Python大佬。

这里其实特想知道他们是团队运营,还是个人运营。不过不管了,先关注去。

这个结果可能也与我用Python这个关键词去搜索有关,一看公众号名字都是带有Python的(CSDN例外)。

  1. from pyecharts import Bar 
  2. import pandas as pd 
  3.  
  4. df = pd.read_csv('sg_articles.csv', header=None, names=["title", "article", "name", "date"]) 
  5.  
  6. list1 = [] 
  7. for j in df['date']: 
  8.     # 获取文章发布年份 
  9.     time = j.split('-')[0] 
  10.     list1.append(time) 
  11. df['year'] = list1 
  12.  
  13. # 选取发布时间为2018年的文章,并对其统计 
  14. df = df.loc[df['year'] == '2018'] 
  15. place_message = df.groupby(['name']) 
  16. place_com = place_message['name'].agg(['count']) 
  17. place_com.reset_index(inplace=True) 
  18. place_com_last = place_com.sort_index() 
  19. dom = place_com_last.sort_values('count', ascending=False)[0:10] 
  20.  
  21. attr = dom['name'] 
  22. v1 = dom['count'] 
  23. bar = Bar("微信文章发布数量TOP10", title_pos='center', title_top='18', width=800, height=400) 
  24. bar.add("", attr, v1, is_convert=True, xaxis_min=10, yaxis_rotate=30, yaxis_label_textsize=10, is_yaxis_boundarygap=True, yaxis_interval=0, is_label_show=True, is_legend_show=False, label_pos='right', is_yaxis_inverse=True, is_splitline_show=False) 
  25. bar.render("微信文章发布数量TOP10.html") 

(编辑:核心网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读