zl程序教程

您现在的位置是:首页 >  数据库

当前栏目

揭开互联网公司的神秘面纱,数据解读那些slay整个行业的互联网公司

2023-03-09 21:56:47 时间

前言:

随着互联网行业的日益兴盛,吸引力越来越多的牛人加入其中,也有许多小伙伴跃跃欲试,想要在互联网的浪潮中大展身手。今天我们通过看准网的数据,帮助大家对各大互联网公司有一个比较概括的了解。

01数据来源

揭开互联网公司的神秘面纱,数据解读那些slay整个行业的互联网公司

看准网提供了许多员工对于公司的评价,我们从中提取需要的数据,包括整体评分、面试难度、推荐率、前景看好情况、CEO支持率,代码如下:

  1. ## 获得信息  
  2. def get_company_info(num,headers): 
  3.    ## 获得评价数据 
  4.    url = 'https://www.kanzhun.com/gsr'+str(num)+'.html?ka=com-blocker1-review' 
  5.    js='window.open("'+url+'")' 
  6.    driver.execute_script(js) 
  7.    time.sleep(5) 
  8.    driver.close()  
  9.    driver.switch_to_window(driver.window_handles[0]) 
  10.    bsObj=BeautifulSoup(driver.page_source,"html.parser"
  11.    tag=bsObj.find('div',attrs={'class':'all_item'}).text.replace('\t','').replace('\n','').replace('(',' ').replace(')',' ').split(' '
  12.    tag=tag[0:len(tag)-1] 
  13.    this_tag = {tag[i*2]:tag[i*2+1] for i in np.arange(int(len(tag)/2-1))} 
  14.    this_name = bsObj.find('div',attrs={'class':'co_name t_center'}).text 
  15.    this_overal = float(bsObj.find('div',attrs={'class':'res_box_star f_right'}).find('em').text) 
  16.    points = bsObj.find('ul',attrs={'class':'score_rate clearfix'}).text.replace('\n',' ').split() 
  17.    this_recommend = float(points[0][0:2])/100*5 
  18.    this_future = float(points[2][0:2])/100*5 
  19.    this_ceo = float(points[4][0:2])/100*5 
  20.    ## 获得CEO头像和公司logo 
  21.    ceo_pic = bsObj.find('div',attrs={'class':'ceo_info'}).find('div').find('img').attrs['src'
  22.    ceo_name = bsObj.find('div',attrs={'class':'ceo_info'}).find('p').text 
  23.    head_logo = bsObj.find('div',attrs={'class':'com_logo f_left'}).find('img').attrs['src'
  24.    head_loc = 'D:/爬虫/看准/公司logo/'+this_name+'.jpg' 
  25.    ceo_loc = 'D:/爬虫/看准/CEOlogo/'+this_name+'.jpg' 
  26.    request.urlretrieve(head_logo,head_loc) 
  27.    request.urlretrieve(ceo_pic,ceo_loc) 
  28.    ## 获得面试难度 
  29.    url = 'https://www.kanzhun.com/gsm'+str(num)+'.html?ka=com-floater-interview' 
  30.    js='window.open("'+url+'")' 
  31.    driver.execute_script(js) 
  32.    time.sleep(5) 
  33.    driver.close()  
  34.    driver.switch_to_window(driver.window_handles[0]) 
  35.    bsObj=BeautifulSoup(driver.page_source,"html.parser"
  36.    req=request.Request(url,headers=headers)   
  37.    html=urlopen(req)   
  38.    bsObj=BeautifulSoup(html.read(),"html.parser")     
  39.    this_difficulty = float(bsObj.find('section',attrs={'class':'interview_feel'}).find('em').text) 
  40.    this_feeling = bsObj.find('ul',attrs={'class':'score_list'}).find_all('span',attrs={'class':'percent'}) 
  41.    this_feeling = [float(k.text.replace('%','')) for k in this_feeling] 
  42.    this_feeling = (this_feeling[0]*5+this_feeling[1]*3+this_feeling[2]*1)/100 
  43.    ## 整合数据成为字典 
  44.    this_company ={'name':this_name,'overal':this_overal,'comments':tag[1],'recommend':this_recommend, 
  45.                   'future':this_future,'ceo':this_ceo,'difficulty':this_difficulty,'feeling':this_feeling}     
  46.    return this_company,this_tag,this_name 

02整体对比

我们最终选取了50家互联网公司作为样本进行对比,选取来源主要是结合2018年互联网公司百强榜单和看准网上的实际评价数量,选取的公司logo拼图如下,我们会在第4部分讲解如何将图片进行拼接:

揭开互联网公司的神秘面纱,数据解读那些slay整个行业的互联网公司

首先对比各项评价指标的TOP15:

揭开互联网公司的神秘面纱,数据解读那些slay整个行业的互联网公司

揭开互联网公司的神秘面纱,数据解读那些slay整个行业的互联网公司

揭开互联网公司的神秘面纱,数据解读那些slay整个行业的互联网公司

揭开互联网公司的神秘面纱,数据解读那些slay整个行业的互联网公司

可以看到,榜单中BAT在各项排名中都处于十分靠前的位置,网易也占据了多个榜单的靠前位置,腾讯霸占了所有排名的TOP1。下面我们再来看一下面试难度,我们选取了面试难度评分的TOP15和BOTTOM15,该数据仅供参考,根据小编的经验,同一个公司的不同部门不同岗位之间的难度差异也非常大。

揭开互联网公司的神秘面纱,数据解读那些slay整个行业的互联网公司

揭开互联网公司的神秘面纱,数据解读那些slay整个行业的互联网公司

在面试难度偏低的一些公司中,有许多非常不错的公司,该数据仅仅是一个参考,真正的面试还是要取决于求职者的实际能力,所谓会者不难,难者不会。真正的大牛无论是面对多么困难的面试,依然可以slay全场。

  1. ## 整体评分top15柱形图 
  2. company=pd.read_excel('company_info.xlsx'
  3. company_overal = company.sort_values('overal',ascending=False)[0:15] 
  4. attr = company_overal['name'
  5. v1=round(company_overal['overal'],2) 
  6. bar = Bar("整体评分TOP15",title_pos='center'
  7. bar.use_theme('essos'
  8. bar.add("", attr, v1, is_stack=False,xaxis_rotate=30,yaxis_min=3.7,is_label_show=True
  9.         xaxis_interval =0,is_splitline_show=False
  10. bar.render('整体评分TOP15.html'

03雷达图

前面我们看的都是各个公司之间的对比,下面我们看一下同一个公司不同维度的情况,我们选取了BAT和TMD作为数据,其他的公司也可以按照同样的方式进行对比,首先看一下BAT:

揭开互联网公司的神秘面纱,数据解读那些slay整个行业的互联网公司

BAT真的是名副其实的业界标杆,各项指标都slay整个行业,下面我们看一下此前发展势头迅猛的TMD三家公司:

揭开互联网公司的神秘面纱,数据解读那些slay整个行业的互联网公司

TMD三家公司和行业整体水平相比,也是出于领先地位,可见其还不错的发展势头,最后放上和小编息息相关的三家公司,具体是哪三家,相信了解小编的朋友一定是可以猜出来的:

揭开互联网公司的神秘面纱,数据解读那些slay整个行业的互联网公司

  1. value_avg = [list(company.iloc[:,[1,3,4,5,6]].mean())] 
  2. value_company0 = [list(company.iloc[0,[1,3,4,5,6]])] 
  3. value_company1 = [list(company.iloc[1,[1,3,4,5,6]])] 
  4. value_company2 = [list(company.iloc[2,[1,3,4,5,6]])] 
  5. c_schema= [{"name""总体评价""max": 4.4, "min": 3.2}, 
  6.           {"name""推荐度""max": 4.75, "min": 2.4}, 
  7.           {"name""前景看好""max": 4.25, "min": 1}, 
  8.           {"name""CEO/董事长认可度""max": 4.8,"min":3}, 
  9.           {"name""面试难度""max": 3.4,"min":2.3}] 
  10. radar = Radar() 
  11. radar.use_theme('essos'
  12. radar.config(c_schema=c_schema, shape='circle'
  13. radar.add(company['name'][0], value_company0, item_color="blue", symbol=None,linewidht=5) 
  14. radar.add(company['name'][1], value_company1, item_color="orange", symbol=None,linewidht=5) 
  15. radar.add(company['name'][2], value_company2, item_color="red", symbol=None,linewidht=5) 
  16. radar.add("整体水平", value_avg, item_color="purple", symbol=None,linewidth=5, 
  17.          legend_selectedmode='multiple'
  18. radar.render('bat.html'

04图片拼接

看准网提供了各个公司的logo和各位公司大佬的头像,我们冒昧地利用这些数据进行简单的图片拼接,制作成一副大的合成图。主要原理是利用numpy中的多维数组进行拼接,由于图像本身就可以看做是一个三维数组(彩色)或者一位数组(黑白),所以我们只需利用数组的拼接方法,就可以达到我们的目的。

代码如下:

  1. ## 拼接公司logo成为5*10的拼图 
  2. i = 0  
  3. for filename in os.listdir("./公司logo"): 
  4.    file_loc = "D:/爬虫/看准/公司logo/"+filename 
  5.    img = mpimg.imread(file_loc)[:,:,0:3] 
  6.    img = cv2.resize(img, (180,180),interpolation=cv2.INTER_AREA) 
  7.    if i % 10 == 0: 
  8.        row_img=img 
  9.    elif i == 9: 
  10.        row_img=np.hstack((row_img,img)) 
  11.        all_img = row_img 
  12.    elif i % 10 == 9: 
  13.        row_img=np.hstack((row_img,img)) 
  14.        all_img = np.vstack((all_img,row_img)) 
  15.    else
  16.        row_img=np.hstack((row_img,img)) 
  17.    i = i+1 
  18. plt.imshow(all_img)     
  19. plt.axis('off')      
  20.  
  21. ## 拼接大佬头像成为7*7的拼图 
  22. i = 0  
  23. for filename in os.listdir("./CEOlogo"): 
  24.    file_loc = "D:/爬虫/看准/CEOlogo/"+filename 
  25.    img = mpimg.imread(file_loc)[:,:,0:3] 
  26.    img = cv2.resize(img, (500,500),interpolation=cv2.INTER_CUBIC) 
  27.    if i % 7 == 0: 
  28.        row_img=img 
  29.    elif i == 6: 
  30.        row_img=np.hstack((row_img,img)) 
  31.        all_img = row_img 
  32.    elif i % 7 == 6: 
  33.        row_img=np.hstack((row_img,img)) 
  34.        all_img = np.vstack((all_img,row_img)) 
  35.    else
  36.        row_img=np.hstack((row_img,img)) 
  37.    i = i+1 
  38. plt.imshow(all_img)     
  39. plt.axis('off'

下面就是我们的效果图,不知道大家是否能一眼就把所有的logo都认全

 

 

揭开互联网公司的神秘面纱,数据解读那些slay整个行业的互联网公司

 

 

最后是各位大佬的拼图,不知道大家第一眼看到的是哪位大佬,第一眼看到的大佬,或许就是你未来的老板

揭开互联网公司的神秘面纱,数据解读那些slay整个行业的互联网公司

作者介绍:徐麟,目前就职于上海唯品会产品技术中心,哥大统计数据狗,从事数据挖掘&分析工作,喜欢用R&Python玩一些不一样的数据