python matplotlib数据可视化案例-生成柱状图,饼图(扇形图),词云。

2023-11-09

目前python,spark,scala十分火爆,于是我就利用爬虫将猎聘上的招聘信息进行了一下获取,相比起来,猎聘上的职位数量还是很多的,3中技术类型以“python,spark,scala”作为关键词,一共爬取了一万多条信息,爬取的主要信息为:公司名称,职位名称,薪资,地址,职位信息。最后将爬取后的数据,进行了简单的处理,进行可视化。

数据获取

爬虫的写法可以查看https://blog.csdn.net/qq_36389249/article/details/87275723,数据爬取主要利用的是selenium,数据使用数据库的方式进行存放

数据展示

上面3个图分别代表的是,python,Scala,saprk的职位数量在城市在'北京', '上海', '广州', '深圳', '南京', '杭州', '西安', '天津', '郑州', '成都', '苏州'的占比,可以很直观在扇形中的看到,大都集中在北京和上海这两个城市,找工作的各位看官,如果想拥有更多的机会,可以考虑下。

这个图是在'北京', '上海', '广州', '深圳', '南京', '杭州', '西安', '天津', '郑州', '成都', '苏州'这几个城市中,发布在猎聘上的数据职位数量信息,还是很多的,至于数量最多的城市也就还是上海和北京。

还有就是我还做了python,spark,scala这三个的薪资的分析,首先是对python的薪资的分析,

{'面议': 879, '18-36万': 140, '12-24万': 135, '12-18万': 128, '18-30万': 123, '24-48万': 80, '18-24万': 76, '10-18万': 66, '24-36万': 53, '20-39万': 37, '13-20万': 28, '18-54万': 28, '24-42万': 26, '36-60万': 26, '30-60万': 24, '21-35万': 23, '21-42万': 23, '20-33万': 22, '24-30万': 22, '26-52万': 22, '10-14万': 21, '14-24万': 20, '13-26万': 20, '7-10万': 18, '10-19万': 17, '30-42万': 17, '7-12万': 17, '21-28万': 16, '12-22万': 16, '10-12万': 16, '23-38万': 15, '14-29万': 15, '10-24万': 15, '5-7万': 15, '7-14万': 14, '14-21万': 14, '30-45万': 13, '14-22万': 13, '30-36万': 13, '30-53万': 12, '14-28万': 12, '20-26万': 12, '8-18万': 12, '28-56万': 12, '16-30万': 11, '8-17万': 10, '11-18万': 10, '22-36万': 10, '26-39万': 10, '36-48万': 10, '28-42万': 10, '12-19万': 10, '16-26万': 9, '13-39万': 9, '12-36万': 9, '30-48万': 9, '14-18万': 8, '10-17万': 8, '14-30万': 8, '42-78万': 8, '23-45万': 8, '36-72万': 8, '11-22万': 8, '22-58万': 8, '12-30万': 8, '7-18万': 7, '6-12万': 7, '6-10万': 7, '10-20万': 7, '35-70万': 7, '13-33万': 7, '33-65万': 7, '11-21万': 6, '19-24万': 6, '10-16万': 6, '7-11万': 6, '22-30万': 6, '14-19万': 6, '12-14万': 6, '24-40万': 6, '30-54万': 5, '5-10万': 5, '24-38万': 5, '12-17万': 5, '35-49万': 5, '8-24万': 5, '18-27万': 5, '39-65万': 5, '27-45万': 5, '48-84万': 5, '18-42万': 4, '42-54万': 4, '2-5万': 4, '16-24万': 4, '16-31万': 4, '18-34万': 4, '35-56万': 4, '33-52万': 4, '16-32万': 4, '11-17万': 4, '28-49万': 4, '18-26万': 4, '17-34万': 4, '4-5万': 4, '15-30万': 4, '21-29万': 4, '14-20万': 4, '16-20万': 4, '12-20万': 4, '17-28万': 4, '23-30万': 4, '19-40万': 4, '12-21万': 4, '10-22万': 4, '36-54万': 4, '45-60万': 4, '19-29万': 4, '16-23万': 3, '13-19万': 3, '26-46万': 3, '18-19万': 3, '19-38万': 3, '23-33万': 3, '10-13万': 3, '8-13万': 3, '8-14万': 3, '6-7万': 3, '8-11万': 3, '18-28万': 3, '13-21万': 3, '14-25万': 3, '45-90万': 3, '8-12万': 3, '16-22万': 3, '13-23万': 3, '8-16万': 3, '7-13万': 3, '14-26万': 3, '26-43万': 3, '48-72万': 3, '33-46万': 3, '29-38万': 3, '18-23万': 3, '11-13万': 3, '20-30万': 3, '27-40万': 3, '20-40万': 3, '13-14万': 3, '24-34万': 2, '12-16万': 2, '14-23万': 2, '33-59万': 2, '25-39万': 2, '34-48万': 2, '20-23万': 2, '48-80万': 2, '20-36万': 2, '11-16万': 2, '19-36万': 2, '14-17万': 2, '18-22万': 2, '17-25万': 2, '20-27万': 2, '26-59万': 2, '17-39万': 2, '32-48万': 2, '26-51万': 2, '22-28万': 2, '45-75万': 2, '12-25万': 2, '10-23万': 2, '21-39万': 2, '18-18万': 2, '65-104万': 2, '11-19万': 2, '4-6万': 2, '18-25万': 2, '9-16万': 2, '40-76万': 2, '39-52万': 2, '16-29万': 2, '22-32万': 2, '30-38万': 2, '42-48万': 2, '35-63万': 2, '41-60万': 2, '51-68万': 2, '5-8万': 2, '24-50万': 2, '20-50万': 2, '44-65万': 2, '19-26万': 2, '60-96万': 2, '24-35万': 2, '21-24万': 2, '15-23万': 2, '11-28万': 2, '27-54万': 2, '22-43万': 2, '27-42万': 2, '38-68万': 2, '20-60万': 2, '35-42万': 2, '28-39万': 1, '22-34万': 1, '17-33万': 1, '10-10万': 1, '25-42万': 1, '21-30万': 1, '38-75万': 1, '13-16万': 1, '2-3万': 1, '17-22万': 1, '17-24万': 1, '16-34万': 1, '16-18万': 1, '9-13万': 1, '21-33万': 1, '17-29万': 1, '23-53万': 1, '22-39万': 1, '14-35万': 1, '15-28万': 1, '42-63万': 1, '20-46万': 1, '22-24万': 1, '7-8万': 1, '54-108万': 1, '10-21万': 1, '25-49万': 1, '27-60万': 1, '11-14万': 1, '26-54万': 1, '10-11万': 1, '16-21万': 1, '27-63万': 1, '27-53万': 1, '18-29万': 1, '40-80万': 1, '20-20万': 1, '8-19万': 1, '5-11万': 1, '15-31万': 1, '16-40万': 1, '23-46万': 1, '13-25万': 1, '7-20万': 1, '6-14万': 1, '30-50万': 1, '22-26万': 1, '60-84万': 1, '13-22万': 1, '15-35万': 1, '17-35万': 1, '14-31万': 1, '48-64万': 1, '240-270万': 1, '42-60万': 1, '30-46万': 1, '19-30万': 1, '84-120万': 1, '24-32万': 1, '54-90万': 1, '36-46万': 1, '26-36万': 1, '26-65万': 1, '14-36万': 1, '24-26万': 1, '22-48万': 1, '36-66万': 1, '17-36万': 1, '52-78万': 1, '27-35万': 1, '18-48万': 1, '43-60万': 1, '42-84万': 1, '11-15万': 1, '26-33万': 1, '47-92万': 1, '42-49万': 1, '29-42万': 1, '30-41万': 1, '29-41万': 1, '30-43万': 1, '24-45万': 1, '72-108万': 1, '21-31万': 1, '40-50万': 1, '38-53万': 1, '23-29万': 1, '22-42万': 1, '65-91万': 1, '17-49万': 1, '53-98万': 1, '20-35万': 1, '27-33万': 1, '25-35万': 1, '104-143万': 1, '6-11万': 1, '46-65万': 1, '66-102万': 1, '17-21万': 1, '32-64万': 1, '36-42万': 1, '33-39万': 1, '9-12万': 1, '38-60万': 1, '18-35万': 1, '1-2万': 1, '13-18万': 1, '15-25万': 1}

sprak的薪资分析:

{'面议': 624, '18-30万': 106, '18-36万': 85, '18-24万': 73, '24-48万': 69, '12-24万': 62, '24-36万': 47, '12-18万': 47, '36-60万': 38, '30-60万': 37, '24-42万': 32, '10-14万': 31, '14-35万': 29, '14-24万': 27, '10-18万': 26, '30-48万': 26, '20-33万': 24, '13-26万': 16, '30-42万': 15, '36-72万': 15, '36-48万': 15, '26-52万': 15, '6-10万': 14, '28-56万': 13, '21-35万': 13, '20-39万': 12, '21-42万': 12, '24-30万': 10, '42-70万': 10, '45-75万': 10, '10-19万': 10, '14-29万': 9, '26-39万': 9, '35-70万': 9, '18-35万': 9, '22-36万': 8, '52-78万': 8, '12-19万': 8, '22-30万': 8, '26-46万': 8, '28-49万': 8, '7-14万': 7, '36-54万': 7, '18-42万': 7, '30-53万': 7, '18-26万': 7, '16-31万': 7, '10-12万': 7, '39-78万': 6, '20-26万': 6, '54-90万': 6, '48-72万': 6, '84-120万': 6, '33-52万': 6, '39-65万': 6, '24-60万': 6, '13-33万': 6, '35-56万': 6, '20-31万': 6, '7-18万': 6, '23-45万': 5, '45-60万': 5, '16-26万': 5, '14-21万': 5, '10-22万': 5, '60-96万': 5, '13-21万': 5, '56-84万': 5, '45-90万': 5, '48-84万': 5, '11-18万': 5, '10-21万': 5, '1-2万': 5, '11-14万': 5, '22-42万': 5, '30-36万': 4, '33-46万': 4, '48-80万': 4, '14-22万': 4, '23-38万': 4, '30-45万': 4, '30-54万': 4, '72-108万': 4, '12-22万': 4, '60-105万': 4, '17-33万': 4, '2-4万': 4, '38-75万': 4, '42-78万': 4, '14-28万': 4, '8-17万': 4, '6-12万': 4, '30-50万': 4, '33-65万': 4, '23-52万': 4, '14-30万': 3, '36-42万': 3, '11-22万': 3, '20-42万': 3, '28-42万': 3, '12-29万': 3, '25-42万': 3, '65-104万': 3, '19-38万': 3, '20-29万': 3, '12-30万': 3, '21-29万': 3, '5-7万': 3, '14-26万': 3, '18-48万': 3, '16-24万': 3, '32-56万': 3, '42-54万': 3, '18-31万': 3, '22-43万': 3, '22-34万': 3, '34-67万': 3, '13-24万': 3, '42-72万': 3, '42-56万': 3, '23-39万': 3, '13-16万': 3, '60-72万': 3, '8-14万': 3, '33-59万': 3, '10-16万': 3, '13-23万': 3, '30-46万': 2, '19-30万': 2, '10-20万': 2, '19-26万': 2, '23-33万': 2, '22-31万': 2, '24-40万': 2, '16-23万': 2, '25-35万': 2, '60-84万': 2, '18-34万': 2, '104-143万': 2, '14-19万': 2, '12-17万': 2, '11-19万': 2, '49-70万': 2, '17-28万': 2, '19-22万': 2, '17-26万': 2, '16-30万': 2, '10-17万': 2, '11-21万': 2, '90-135万': 2, '32-64万': 2, '38-60万': 2, '13-39万': 2, '20-41万': 2, '5-10万': 2, '24-49万': 2, '23-46万': 2, '15-30万': 2, '9-18万': 2, '18-23万': 2, '15-22万': 2, '2-5万': 2, '26-38万': 2, '19-36万': 2, '5-6万': 2, '13-18万': 2, '27-53万': 2, '29-41万': 2, '6-8万': 2, '32-66万': 2, '17-32万': 2, '10-24万': 2, '7-10万': 2, '28-35万': 1, '16-21万': 1, '21-28万': 1, '7-20万': 1, '30-38万': 1, '4-6万': 1, '34-60万': 1, '38-45万': 1, '13-22万': 1, '36-46万': 1, '35-63万': 1, '39-46万': 1, '11-17万': 1, '8-10万': 1, '23-47万': 1, '23-60万': 1, '33-39万': 1, '12-20万': 1, '31-49万': 1, '34-55万': 1, '39-59万': 1, '60-90万': 1, '8-13万': 1, '120000-180000万': 1, '36-67万': 1, '26-29万': 1, '44-65万': 1, '19-50万': 1, '70-112万': 1, '52-91万': 1, '33-53万': 1, '49-91万': 1, '15-45万': 1, '29-35万': 1, '15-20万': 1, '68-113万': 1, '38-74万': 1, '10-29万': 1, '16-22万': 1, '20-30万': 1, '23-42万': 1, '17-34万': 1, '75-98万': 1, '36-52万': 1, '24-38万': 1, '20-46万': 1, '16-25万': 1, '17-35万': 1, '20-50万': 1, '16-18万': 1, '26-65万': 1, '12-36万': 1, '9-16万': 1, '42-48万': 1, '26-32万': 1, '23-30万': 1, '10-23万': 1, '39-52万': 1, '24-34万': 1, '38-53万': 1, '48-60万': 1, '17-24万': 1}

scala的薪资分析:

{'面议': 649, '18-36万': 117, '24-48万': 102, '18-30万': 90, '12-18万': 55, '24-36万': 53, '12-24万': 50, '10-18万': 39, '18-24万': 37, '30-60万': 35, '36-60万': 29, '30-42万': 23, '24-42万': 22, '21-35万': 21, '30-48万': 20, '10-14万': 19, '23-45万': 17, '28-56万': 16, '22-36万': 16, '21-42万': 15, '16-30万': 15, '26-52万': 14, '36-72万': 14, '20-33万': 13, '20-39万': 13, '12-22万': 12, '10-12万': 11, '48-72万': 11, '36-54万': 11, '14-28万': 11, '7-14万': 10, '14-30万': 10, '30-36万': 10, '13-20万': 10, '30-54万': 9, '22-30万': 9, '24-60万': 9, '14-24万': 9, '13-26万': 8, '24-30万': 8, '28-49万': 8, '48-84万': 8, '28-42万': 7, '65-104万': 7, '33-65万': 7, '12-30万': 7, '10-19万': 7, '39-52万': 7, '19-30万': 7, '25-49万': 7, '21-49万': 6, '20-26万': 6, '14-29万': 6, '42-70万': 6, '42-84万': 6, '35-56万': 6, '17-33万': 5, '25-35万': 5, '36-48万': 5, '14-22万': 5, '38-60万': 5, '35-70万': 5, '18-48万': 5, '35-49万': 5, '39-65万': 4, '30-53万': 4, '22-34万': 4, '60-96万': 4, '12-36万': 4, '18-23万': 4, '18-35万': 4, '33-46万': 4, '14-21万': 4, '8-17万': 4, '38-75万': 4, '16-31万': 4, '10-24万': 4, '21-28万': 3, '52-78万': 3, '54-90万': 3, '19-50万': 3, '42-60万': 3, '14-35万': 3, '6-10万': 3, '45-75万': 3, '56-84万': 3, '39-78万': 3, '2-4万': 3, '16-24万': 3, '26-36万': 3, '16-26万': 3, '22-42万': 3, '26-46万': 3, '60-84万': 3, '8-12万': 3, '7-12万': 3, '56-98万': 3, '48-56万': 3, '20-36万': 3, '14-25万': 3, '38-53万': 3, '24-41万': 3, '12-19万': 3, '18-26万': 2, '42-72万': 2, '17-25万': 2, '18-25万': 2, '13-21万': 2, '42-78万': 2, '11-21万': 2, '16-32万': 2, '7-10万': 2, '72-108万': 2, '16-22万': 2, '9-16万': 2, '26-39万': 2, '42-56万': 2, '20-29万': 2, '32-64万': 2, '23-39万': 2, '23-38万': 2, '18-42万': 2, '24-34万': 2, '29-58万': 2, '8-14万': 2, '19-36万': 2, '22-43万': 2, '15-30万': 2, '19-42万': 2, '12-14万': 2, '10-17万': 2, '26-51万': 2, '60-105万': 2, '60-72万': 2, '30-38万': 2, '20-28万': 2, '45-90万': 2, '10-13万': 2, '17-24万': 2, '30-40万': 2, '28-36万': 2, '54-108万': 2, '10-16万': 2, '42-80万': 2, '27-53万': 2, '11-22万': 2, '10-20万': 2, '72-96万': 2, '48-54万': 2, '18-28万': 2, '40-80万': 2, '12-29万': 2, '60-90万': 2, '48-80万': 1, '15-22万': 1, '46-78万': 1, '108-132万': 1, '13-22万': 1, '36-66万': 1, '17-26万': 1, '26-29万': 1, '11-28万': 1, '16-23万': 1, '27-45万': 1, '25-42万': 1, '32-44万': 1, '58-72万': 1, '2-5万': 1, '5-6万': 1, '8-13万': 1, '40-64万': 1, '11-14万': 1, '16-21万': 1, '17-30万': 1, '20-52万': 1, '28-63万': 1, '30-43万': 1, '20-60万': 1, '30-68万': 1, '20-38万': 1, '84-112万': 1, '23-46万': 1, '33-52万': 1, '34-48万': 1, '29-45万': 1, '22-39万': 1, '64-112万': 1, '13-24万': 1, '17-28万': 1, '19-26万': 1, '21-29万': 1, '17-23万': 1, '48-96万': 1, '8-18万': 1, '7-13万': 1, '12-23万': 1, '6-8万': 1, '46-65万': 1, '30-45万': 1, '64-96万': 1, '42-66万': 1, '22-29万': 1, '56-88万': 1, '21-56万': 1, '18-18万': 1, '20-42万': 1, '31-48万': 1, '39-70万': 1, '45-99万': 1, '28-70万': 1, '24-32万': 1, '15-23万': 1, '29-48万': 1, '17-34万': 1, '29-63万': 1, '24-38万': 1, '17-27万': 1, '42-48万': 1, '12-20万': 1, '59-78万': 1, '14-26万': 1, '32-48万': 1, '31-50万': 1, '75-120万': 1, '13-23万': 1, '42-49万': 1, '54-78万': 1, '36-42万': 1, '4-6万': 1, '28-50万': 1, '26-65万': 1, '45-68万': 1, '49-70万': 1, '4-7万': 1, '11-18万': 1, '43-68万': 1, '5-7万': 1, '23-29万': 1, '22-56万': 1, '12-17万': 1, '10-22万': 1, '4-4万': 1, '56-75万': 1, '38-45万': 1, '4-10万': 1, '13-33万': 1, '23-33万': 1, '34-38万': 1, '18-34万': 1, '19-38万': 1, '22-32万': 1}

可以看到这个薪资水平真的很恐怖。。。。。(4000块的我瑟瑟发抖啊)。。。

这个薪资拿起来其实并不容易,看下有关职位信息的词云就明白了。

3个词云图分别是python,spark,scala的,可见开发经验是十分重要的啊,不难发现,其实3-5年的就是大佬。所以我还是安心搬砖吧

while(1):
    print("工作需要经验")
    print("找工作")
    if("你有钱"):
        break
print("睡醒了")

 

介绍下,上面个数据可视化的做法主要使用的为matplotlib的库。至于说词云的话,那个很简单,这个图表的制作其实也不难,主要就是对人家库的应用。都说用python就是站在巨人的肩膀上,我发现被人站在肩膀上,我在巨人的脚脖子上。


from collections import Counter
import pymysql
import re
from decimal import Decimal
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
from matplotlib import collections, colors, transforms
from matplotlib.ticker import MultipleLocator,FormatStrFormatter
import numpy as np
import pandas as pd
import time#因为多个图片显示加入了睡眠,方便数据观察
import random
from pylab import *

global my_address
my_address = ['北京', '上海', '广州', '深圳', '南京', '杭州', '西安', '天津', '郑州', '成都', '苏州']
def link_mysql():
    config = {
        'host':'127.0.0.1',
        'user':'root',
        'passwd':'1995104',
        'port':8080,
        'db':'lp',
        'charset':'utf8',
    }
    #进行数据库的连接
    conn = pymysql.connect(**config)
    #获取游标
    cur = conn.cursor()
    #数据读取主要读取内容为地区。
    sql = "select address from python;"
    global python_address
    cur.execute(sql)
    python_address = cur.fetchall()
    sql = "select address from spark;"
    global spark_address
    cur.execute(sql)
    spark_address = cur.fetchall()
    # print(spark_address)
    sql = "select address from scala;"
    global scala_address
    cur.execute(sql)
    scala_address = cur.fetchall()
    # print(scala_address)

    #读取数据获取薪资的列数据
    sql = 'select salary from python;'
    global python_salary
    cur.execute(sql)
    python_salary = cur.fetchall()
    sql = 'select salary from scala;'
    global scala_salary
    cur.execute(sql)
    scala_salary = cur.fetchall()
    sql = 'select salary from spark;'
    global spark_salary
    cur.execute(sql)
    spark_salary = cur.fetchall()
    # print(python_salary)
    # print(scala_salary)
    # print(spark_salary)

    # 获取区域内的工资情况,应为城市数据大多分布在北京 上海 深圳 广州 杭州。
    global python_address_salary
    #获取所有的工资数据
    python_address_salary = {'北京':[], '上海':[], '广州':[], '深圳':[],
                             '南京':[], '杭州':[], '西安':[], '天津':[],
                             '郑州':[], '成都':[], '苏州':[]}
    sql = 'select * from python limit {},1;'
    for i in range(0,len(python_address)):
        cur.execute(sql.format(str(i)))
        address_ = cur.fetchall()[0][3]
        #利用正则表达式获取地区
        address_ = re.findall('[\u4e00-\u9fa5]*',address_)
        # print(address)
        cur.execute(sql.format(str(i)))
        salary = cur.fetchall()[0][4]
        # print(salary)
        # address = re.findall('[\u4e00-\u9fa5]*',address)
        #获取对应地区的薪资内容
        for j in range(0,len(my_address)):
            if address_[0] == my_address[j]:
                python_address_salary[my_address[j]].append(salary)
    # print(python_address_salary)
    #scala的数据内容
    global scala_address_salary
    scala_address_salary = {'北京': [], '上海': [], '广州': [], '深圳': [],
                             '南京': [], '杭州': [], '西安': [], '天津': [],
                             '郑州': [], '成都': [], '苏州': []}
    sql = 'select * from scala limit {},1;'
    for i in range(0, len(scala_address)):
        cur.execute(sql.format(str(i)))
        #通过正则表达式获取地址数据
        address_ = cur.fetchall()[0][3]
        address_ = re.findall('[\u4e00-\u9fa5]*', address_)
        # print(address)
        cur.execute(sql.format(str(i)))
        salary = cur.fetchall()[0][4]
        # print(salary)
        # address = re.findall('[\u4e00-\u9fa5]*',address)
        for j in range(0,len(my_address)):
            if address_[0] == my_address[j]:
                scala_address_salary[my_address[j]].append(salary)

    # print(scala_address_salary)

    #spark的数据展示
    global spark_address_salary
    spark_address_salary = {'北京': [], '上海': [], '广州': [], '深圳': [],
                            '南京': [], '杭州': [], '西安': [], '天津': [],
                            '郑州': [], '成都': [], '苏州': []}
    sql = 'select * from spark limit {},1;'
    for i in range(0, len(spark_address)):
        cur.execute(sql.format(str(i)))
        address_ = cur.fetchall()[0][3]
        address_ = re.findall('[\u4e00-\u9fa5]*', address_)
        # print(address)
        cur.execute(sql.format(str(i)))
        salary = cur.fetchall()[0][4]
        # address = re.findall('[\u4e00-\u9fa5]*',address)
        for j in range(0,len(my_address)):
            if address_[0] == my_address[j]:
                spark_address_salary[my_address[j]].append(salary)

    # print(spark_address_salary)
    cur.close()
    conn.close()

def get_address():
    global scala_add
    add = []
    str_my = ''
    #分析scala的主要职聘地址
    for scala in scala_address:
        scala = re.match('[\u4e00-\u9fa5]+',scala[0])
        add.append(scala)
    for m_scala in add:
        if m_scala is not None:
            # print(m_scala.group())
            str_my = str_my+m_scala.group(0)+'\n'
    # print(str_my)
    new_txt = re.split('\W+',str_my)
    result = Counter(new_txt)
    global result_scala_address
    result_scala_address = result.most_common(len(scala_address))
    # print(result_scala_address)
    str_my_b = ''
    add.clear()
    #分析python的地址
    for python in python_address:
        python = re.match('[\u4e00-\u9fa5]+',python[0])
        add.append(python)
    for m_python in add:
        if m_python is not None:
            str_my_b = str_my_b+m_python.group(0)+'\n'
    new_txt = re.split('\W+',str_my_b)
    result = Counter(new_txt)
    global result_python_address
    result_python_address = result.most_common(len(python_address))
    # print(result_python_address)
    str_my_a = ''
    add.clear()
    #分析spark的主要地址
    for spark in spark_address:
        spark = re.match('[\u4e00-\u9fa5]+',spark[0])
        add.append(spark)
    for m_spark in add:
        if m_spark is not None:
            str_my_a = str_my_a+m_spark.group(0)+'\n'
    new_txt = re.split('\W+',str_my_a)
    result = Counter(new_txt)
    global result_spark_address
    result_spark_address = result.most_common(len(spark_address))
    # print(result_spark_address)
    # b = 0
    # for  a in result_python_address:
    #     b =  a[1]+b
    # print(b)
    #获取百分比 百分比在绘制扇形图时已经实现,注释多余程序
    # global n_python,address
    # n_python = []
    # address = []
    # for result in result_python_address:
    #     n_python.append(float(Decimal(result[1]/len(python_address)).quantize(Decimal('0.000'))))
    #     address.append(result[0])
    # n_python = dict(zip(address,n_python))
    # # print(n_python)
    #
    # address.clear()
    # global n_scala
    # n_scala = []
    # for result in result_scala_address:
    #     n_scala.append(float(Decimal(result[1]/len(scala_address)).quantize(Decimal('0.000'))))
    #     address.append(result[0])
    # n_scala = dict(zip(address,n_scala))
    # # print(n_scala)
    #
    # address.clear()
    # global n_spark
    # n_spark = []
    # for result in result_spark_address:
    #     n_spark.append(float(Decimal(result[1]/len(spark_address)).quantize(Decimal('0.000'))))
    #     address.append(result[0])
    # n_spark = dict(zip(address,n_spark))
    # print(n_spark)

#获取薪资
def get_salary():
    str_ = ''
    global result_python_salary
    for python in python_salary:
        str_ = str_+python[0].replace('万','')+' '
    str_.replace('万', ' ')
    result_python_salary = str_
    str_ = ''
    global result_scala_salary
    for scala in scala_salary:
        str_ = str_+scala[0].replace('万','')+' '
    str_.replace('万', ' ')
    result_scala_salary = str_
    str_ = ''
    global result_spark_salary
    for spark in spark_salary:
        str_ = str_+spark[0].replace('万','')+' '
    str_.replace('面议','')
    result_spark_salary = str_

    new_txt = re.split(' ',result_python_salary)
    result = Counter(new_txt)
    result_python_salary = result.most_common(len(result_python_salary))

    new_txt = re.split(' ', result_scala_salary)
    result = Counter(new_txt)
    result_scala_salary = result.most_common(len(result_scala_salary))

    new_txt = re.split(' ', result_spark_salary)
    result = Counter(new_txt)
    result_spark_salary = result.most_common(len(result_spark_salary))

    result1 =  []
    result2 = []
    for result in result_python_salary:
        if result[0] == "":
            continue
        else:
            if (result[0] != '面议'):
                result1.append(result[0] + '万')
            else:
                result1.append(result[0])
            result2.append(result[1])
    result_python_salary = dict(zip(result1,result2))

    result1 =  []
    result2 = []
    for result in result_scala_salary:
        if result[0] == "":
            continue
        else:
            if (result[0] != '面议'):
                result1.append(result[0] + '万')
            else:
                result1.append(result[0])
            result2.append(result[1])
    result_scala_salary = dict(zip(result1,result2))

    result1 =  []
    result2 = []
    for result in result_spark_salary:
        if result[0] == "":
            continue
        else:
            if(result[0] != '面议'):
                result1.append(result[0]+'万')
            else:
                result1.append(result[0])
            result2.append(result[1])
    result_spark_salary = dict(zip(result1,result2))
    #数据表示的内容位各个类型的工资的数量情况
    print(result_python_salary)
    print(result_scala_salary)
    print(result_spark_salary)
    # #
    # print(len(result_python_salary))
    # print(len(result_scala_salary))
    # print(len(result_spark_salary))


def bar_show():

    global x1#每个城市拥有的对应职位数量
    x1 = [1]*len(my_address)
    plt.rcParams['font.sans-serif'] = ['SimHei'] #用来显示汉字
    plt.rcParams['axes.unicode_minus'] = False #用来显示负号
    #绘制默认图纸

    plt.figure(1)#创建图表
    plt.figure(2)#创建图表
    plt.figure(3)#创建图表
    plt.subplots_adjust(hspace=2)
    ax1 = plt.subplot(3,1,1)
    ax2 = plt.subplot(3,1,2)
    ax3 = plt.subplot(3,1,3)
    #获取城市名称和数量
    for result in result_python_address:
        for i in range(0,len(my_address)-1):
            if(result[0] == my_address[i]):
                x1[i] = result[1]#对应获取城市中的职位数据

    # plt.figure(figsize=(10,8))
    #x,y的标签设置
    plt.figure(1)
    plt.sca(ax1)
    ax1.spines['top'].set_visible(False)
    ax1.spines['right'].set_visible(False)
    plt.xlabel('城市名称')
    plt.ylabel('python职位数量/个')
    plt.xticks(rotation=90,)
    # plt.yticks(np.random.randint(0,max(x1),800))
    plt.ylim((0,max(x1)+100))
    plt.yticks(np.arange(0,max(x1)+100,500))
    plt.legend()
    plt.bar(my_address,x1,color='Red')
    # plt.plot(address, x1)
    autolabe(my_address,x1)
    # plt.savefig('python.jpg')
    global x2
    x2 = [1]*len(my_address)
    plt.figure(2)
    plt.sca(ax2)
    ax2.spines['top'].set_visible(False)
    ax2.spines['right'].set_visible(False)
    for result in result_scala_address:
        for i in range(0,len(my_address)-1):
            if(result[0] == my_address[i]):
                x2[i] = result[1]#对应获取城市中的职位数据
    plt.xlabel('城市名称')
    plt.ylabel('scala职位数量/个')
    plt.xticks(rotation=90,)
    # plt.yticks(np.random.randint(0, max(x2), 800))
    plt.ylim((0,max(x2)+100))
    plt.yticks(np.arange(0,max(x2)+100,200))
    plt.legend()
    plt.bar(my_address,x2,color='GREEN')
    # plt.plot(address,x2)
    autolabe(my_address,x2)
    # plt.savefig('scala.jpg')
    global x3
    x3 = [1]*len(my_address)
    plt.figure(3)
    plt.sca(ax3)
    ax3.spines['top'].set_visible(False)
    ax3.spines['right'].set_visible(False)
    for result in result_spark_address:
        for i in range(0,len(my_address)-1):
            if(result[0] == my_address[i]):
                x3[i] = result[1]#对应获取城市中的职位数据
    # x = x1+x2+x3
    # x = {}.fromkeys(x).keys()
    # print(len(x))
    plt.xlabel('城市名称')
    plt.ylabel('spark职位数量/个')
    plt.xticks(rotation=90,)
    # plt.yticks(np.random.randint(0, max(x3), 800))
    plt.ylim((0,max(x3)+100))
    plt.yticks(np.arange(0,max(x3)+100,200))
    plt.legend()
    plt.bar(my_address,x3,color='BLUE')
    # plt.plot(address, x3)
    autolabe(my_address,x3)
    plt.savefig('resulte_address.jpg')
    plt.show()

def pie1_show():
    # grids = GridSpec(3,1)
    plt.figure(1,figsize=(8,12))#创建图表
    # plt.figure(2)#创建图表
    # plt.figure(3)#创建图表
    ax = plt.subplot()
    plt.subplots_adjust(hspace=2)
    plt.rcParams['font.sans-serif'] = ['SimHei'] #用来显示汉字
    plt.rcParams['axes.unicode_minus'] = False #用来显示负号
    plt.pie(x=x1,  # 绘图数据
            labels=my_address,  # 添加标签
            autopct='%.1f%%',  # 设置百分比的格式,这里保留一位小数
            pctdistance=0.8,  # 设置百分比标签与圆心的距离
            labeldistance=1.15,  # 设置标签与圆心的距离
            startangle=180,  # 设置饼图的初始角度
            radius=80,  # 设置饼图的半径
            counterclock=False,  # 是否逆时针,这里设置为顺时针方向
            wedgeprops={'linewidth': 1, 'edgecolor': 'black'},  # 设置饼图内外边界的属性值
            textprops={'fontsize': 15, 'color': 'w'},  # 设置文本标签的属性值
            center=(0, 0),  # 设置饼图的原点
            frame=1)  # 是否显示饼图的图框,这里设置显示
    plt.axis('equal')
    plt.legend(loc='upper left')
    # plt.axis('off') #一行代码实现去除坐标轴
    ax.spines['top'].set_visible(False)
    ax.spines['left'].set_visible(False)
    ax.spines['right'].set_visible(False)
    ax.spines['bottom'].set_visible(False)
    plt.xticks([])
    plt.yticks([])
    plt.title('Python各城市占的职位数量比重',fontsize=20)
    plt.savefig('pie1.jpg')
    plt.show()
    time.sleep(4)
def pie2_show():
    plt.figure(1, figsize=(8, 12))  # 创建图表
    ax = plt.subplot()
    plt.subplots_adjust(hspace=2)
    plt.rcParams['font.sans-serif'] = ['SimHei'] #用来显示汉字
    plt.rcParams['axes.unicode_minus'] = False #用来显示负号
    # plt.pie(x2,labels=address,autopct='%1.0f%%',startangle=90,textprops={'fontsize':8,'color':'w'},
    #         pctdistance= 0.9,radius=0.8,center=(0.5,0.5))
    # 控制x轴和y轴的范围

    plt.pie(x=x2,  # 绘图数据
            labels=my_address,  # 添加标签
            autopct='%.1f%%',  # 设置百分比的格式,这里保留一位小数
            pctdistance=0.8,  # 设置百分比标签与圆心的距离
            labeldistance=1.15,  # 设置标签与圆心的距离
            startangle=180,  # 设置饼图的初始角度
            radius=80,  # 设置饼图的半径
            counterclock=False,  # 是否逆时针,这里设置为顺时针方向
            wedgeprops={'linewidth': 1, 'edgecolor': 'black'},  # 设置饼图内外边界的属性值
            textprops={'fontsize': 15, 'color': 'w'},  # 设置文本标签的属性值
            center=(0, 0),  # 设置饼图的原点
            frame=1)  # 是否显示饼图的图框,这里设置显示
    plt.axis('equal')
    plt.legend(loc='upper left')
    ax.spines['top'].set_visible(False)
    ax.spines['left'].set_visible(False)
    ax.spines['right'].set_visible(False)
    ax.spines['bottom'].set_visible(False)
    plt.xticks([])
    plt.yticks([])
    plt.title('Scala各城市占的职位数量比重',fontsize=20)
    plt.savefig('pie2.jpg')
    plt.show()
    time.sleep(4)
def pie3_show():
    plt.figure(1, figsize=(8, 12))  # 创建图表
    plt.subplots_adjust(hspace=2)
    ax = plt.subplot()
    plt.rcParams['font.sans-serif'] = ['SimHei'] #用来显示汉字
    plt.rcParams['axes.unicode_minus'] = False #用来显示负号
    plt.pie(x=x3,  # 绘图数据
            labels=my_address,  # 添加标签
            autopct='%.1f%%',  # 设置百分比的格式,这里保留一位小数
            pctdistance=0.8,  # 设置百分比标签与圆心的距离
            labeldistance=1.15,  # 设置标签与圆心的距离
            startangle=180,  # 设置饼图的初始角度
            radius=80,  # 设置饼图的半径
            counterclock=False,  # 是否逆时针,这里设置为顺时针方向
            wedgeprops={'linewidth': 1, 'edgecolor': 'black'},  # 设置饼图内外边界的属性值
            textprops={'fontsize': 15, 'color': 'w'},  # 设置文本标签的属性值
            center=(0, 0),  # 设置饼图的原点
            frame=1)  # 是否显示饼图的图框,这里设置显示
    plt.axis('equal')
    plt.legend(loc='upper left')
    #去除坐标的周边的线
    ax.spines['top'].set_visible(False)
    ax.spines['left'].set_visible(False)
    ax.spines['right'].set_visible(False)
    ax.spines['bottom'].set_visible(False)
    plt.xticks([])
    plt.yticks([])
    plt.title('Spark各城市占的职位数量比重',fontsize=20)
    plt.savefig('pie3.jpg')
    plt.show()
#设置显示柱子上的数据
def autolabe(x,y):
    for _x, _y in zip(x, y):
        plt.text(_x, _y, '%d' % _y,
                 ha='center', va='bottom', size=8
                 )
def bar_python():
    # plt.figure(figsize=(19,13))
    fig,ax = plt.subplots()
    plt.rcParams['font.sans-serif'] = ['SimHei'] #用来显示汉字
    plt.rcParams['axes.unicode_minus'] = False #用来显示负号
    #获取Python中的薪资的数量
    salary = [salary for salary in result_python_salary.values()]
    my_type = [my_type for my_type in result_python_salary.keys()]
    # y_pos = np.arange(len(my_type))
    # perfomance = 3+10*np.random.rand(len(my_type))
    # error = np.random.rand(len(my_type))
    # ax.tick_params(which=len(my_type))
    ax.tick_params(axis = "y",width = (max(salary)+20),pad = 3)#设置坐标轴宽度
    ax.tick_params(axis = "x",width = (len(my_type)+20),pad = 3) #设置坐标轴高度

    # ax.barh(y_pos,perfomance,xerr=error,align='center',color="BLUE",ecolor='GREEN')
    # ax.set_yticks(y_pos)
    # ax.set_yticklabels(my_type)
    # ax.invert_yaxis()
    plt.ylim(0,(max(salary)+20))
    # plt.xlim(0,20)
    plt.xticks(rotation=90,)
    # autolabe(my_type,salary)
    ax.plot(my_type,salary,'o')
    for label in ax.get_xticklabels():
        label.set_visible(False)
    for label in ax.get_xticklabels()[::20]:
        label.set_visible(True)

    # plt.savefig("{}.jpg".format(date), dpi=500)
    plt.savefig("python_bar.jpg",dpi=500)
    plt.show()


if __name__ == '__main__':
    link_mysql()
    get_address()
    get_salary()
    bar_show()
    pie1_show()
    pie2_show()
    pie3_show()
    bar_python()





 

 

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

python matplotlib数据可视化案例-生成柱状图,饼图(扇形图),词云。 的相关文章

  • Power bi 4.6 聚类图

    关注微信公共号 小程在线 关注CSDN博客 程志伟的博客 数据集链接见微信公共号底端 1 在Power BI中导入可视化效果 点击 选择导入自定义视觉对象 点击导入 2 选择我们需要导入的视觉对象 3 在可视化就会出现新的图形 4 导入 D
  • 用Matlab作函数的图像

    函数简介 1 作图函数是plot 其调用格式如下 plot y plot x y plot x y LineSpec plot x1 y1 s1 x2 y2 s2 x3 y3 s3 说明 1 plot y 绘出以向量y为纵坐标 y的个元素的
  • python 头条 sign 参数 此篇针对实时列表 请使用73版本的谷歌浏览器

    1 首先谷歌浏览器打开今日头条F12调试找到sources 以旅游模块为例以此类推都一样 网站如https www toutiao com ch news travel 2 ctrl shift f全局搜索 window byted acr
  • 帆软大屏开发手册

    1 需求调研 模块 输出 业务需求调研 业务需求调研报告 硬件调研 大屏采购硬件清单 数据调研 数据质量调研报告 关键性技术预研 技术预研报告 1 1 业务需求调研 1 1 1 根据业务场景抽取关键指标 关键指标是一些概括性词语 是对一组或
  • Python3安装包下载(附3.8.7、3.7.9、3.6.8版本)

    三部曲 1 到 源码 网站源码 源码下载 源码之家 站长下载 搜索 Python 并下载 搜索结果在较底部 2 到官网 https www python org downloads 对应版本的页面 如 https www python or
  • 数据可视化平台理论与实践

    前面说完了大数据开发平台的核心组件 作业调度系统 接下来讨论一下大数据开发平台的脸面之一 数据可视化平台 和调度系统一样 这又是一个很多公司可能想要自己造一个轮子的系统 数据可视化平台是什么 不过 慢着 先等一下 什么是数据可视化平台 我们
  • Plotly Express 详细使用指南,20组案例从入门到进阶(附源代码)

    作者 阳哥 出品 Python数据之道 ID PyDataLab 大家好 我是阳哥 今天跟大家分享的是 Plotly Express 的详细使用教程 Plotly Express 是 Python 交互式可视化库 Plotly 的高级组件
  • Python3 如何优雅地使用正则表达式(详解四)

    更多强大的功能 到目前为止 我们只是介绍了正则表达式的一部分功能 在这一篇中 我们会学习到一些新的元字符 然后再教大家如何使用组来获得被匹配的部分文本 更多元字符 还有一些元字符我们没有讲到 接下来小甲鱼一一为大家讲解 有些元字符它们不匹配
  • Python爬虫实战,requests模块,Python实现IMDB电影top数据可视化

    前言 利用Python爬取IMDB电影 废话不多说 让我们愉快地开始吧 开发工具 Python版本 3 6 4 相关模块 requests模块 random模块 bs4模块 以及一些Python自带的模块 环境搭建 安装Python并添加到
  • python线程与进程概述_1.24

    多进程与多线程 进程 Process 是计算机中的程序关于某数据集合上的一次运行活动 是系统进行资源分配和调度的基本单位 是操作系统结构的基础 线程 Thread 有时被称为轻量级进程 Lightweight Process LWP 是程序
  • 爬取豆瓣电影数据并进行分析可视化

    学习爬虫爬取豆瓣电影数据并进行分析 整体流程如下 1 爬取豆瓣电影数据 2 读取豆瓣电影数据 3 统计各个电影的评论数 4 读取某个电影的全部评论内容 5 获取某个电影的关键词并生成词云图 6 对电影数据的关键词和评分进行辩证分析并生成热力
  • 基于Python实现 传感器的随机布置 传感网覆盖仿真

    代码演示 import tkinter as tk import random import win32gui import cv2 import time import math from PIL import Image ImageGr
  • 数字孪生系统:智慧城市数据可视化

    分享几个我觉得很泛用的智慧城市可视化大屏模板 功能齐全且强大 画面美观且酷炫 模板一 智慧城市可视化应用管理平台 整合城市相关数据资源 对公共环境 人员民生 公共安全等领域的核心指标进行态势监测与可视分析 辅助管理者全面掌控城市运行态势 提
  • PCL 大窗口可视化两个点云

    一 主要参数 viewer gt setFullScreen true 设置点云为全屏显示的2D俯视图 二 代码实现 1 一个大窗口可视化两个点云 include
  • Python3 configparse模块(配置)

    Python3 configparse模块 配置 参考 https www cnblogs com bert227 p 9326313 html https www cnblogs com dion 90 p 7978081 html py
  • 利用python(networkx库)画带权&不带权有向图、无向图

    利用python networkx库 画带权 不带权有向图 无向图 效果展示 分段代码 全部源代码 传送门 https download csdn net download weixin 44978992 12719404 当我们处理完几百
  • chart.js使用学习——柱状图(2:常用属性设置)

    本文介绍柱状图常用属性及效果 柱状图中有部分常用属性与折线图用法相同 本文仅列出这些属性的简要说明 不再详细说明 base 设置图形绘制时的基准值 数值型 默认值为空 设置的值为数值轴上的值 base值未设置 则绘制的柱状图沿数值轴方向的起
  • 大数据分析毕设之基于python的电影知识图谱可视化系统

    S2023002大数据分析毕设之基于python的电影知识图谱可视化系统 https www bilibili com video BV12N4y1A72J share source copy web vd source 3d18b0a7b
  • 案例分享|企业为什么要选择数字化转型?

    数字化在现代社会中扮演着重要的角色 成为企业转型的必由之路 随着科技的发展和信息化的进程 越来越多的企业开始拥抱数字化转型 以应对市场的变化和竞争的压力 数字化带来了诸多好处 不仅提高了企业的效率和生产力 还拓展了企业的经营领域和市场空间
  • 航空港务数据大屏为航空港的可持续发展提供有力支撑!

    随着经济的发展 不断加建与扩建民用机场 空港行业规模不断扩大 在不断引进和消化发达国家先进技术的同时 中国深入开展了对新技术和新材料的研究 极大地丰富和发展了中国的机场建设技术 且各项机场建设计划均已落实推进 行业在经济发展的推动下欣欣向荣

随机推荐

  • linux 测试网络连通性方法

    一 telnet 方法 telnet 协议是 TCP IP 协议族中的一员 是 Internet 远程登陆服务的标准协议和主要方式 它为用户提供了在本地计算机上完成远程主机工作的能力 因此我们可以使用telnet 来测试远程机器的连通性 t
  • VMware安装RHEL 8.2(红帽)

    一 创建虚拟机 打开VMware 点击 创建新的虚拟机 点击自定义 下一步 选择兼容性 15 x 兼容性选VMware的版本 稍后安装操作系统 选择镜像对应的操作系统类型及版本 系统镜像按自己准备的选择即可 自定义虚拟机名称及安装的位置 名
  • 数组的方法以及特征

    数组变成一个字符串 1 join 可以在每一个元素中加一个字符串 2 toString pop 删除数组最后一个元素 push 增加数组 reverse 反转 slice 从下标开始取 sort 对数组进行排序 splice 删除数组的某几
  • 取消全部呼叫转移代码_中国移动的卡取消呼叫转移的快捷方式是什么?

    展开全部 取消已设置的所有呼转可用手机拨打 002 取62616964757a686964616fe59b9ee7ad9431333365663562消关机或无信号时转移可用手机拨打 62 取消无人接听时转移可用手机拨打 61 取消遇忙音占
  • 即时通讯(IM)开源项目OpenIM对WebAssembly支持,提升web端体验

    WebAssembly 是什么 2019 年 12 月 W3C 标准批准了第四种官方语言 WebAssembly Wasm 这种语言在结构 使用和功能方面与以前的语言有很大不同 WebAssembly 是一种新的编码方式 可以在现代的Web
  • [1138]java中json的使用和解析

    文章目录 1 创建json对象 1 1 创建JSONObject对象 1 2 创建JSONArray对象 2 解析json 2 1 官方json包解析 2 2 fastjson解析 2 3 jackson解析 1 创建json对象 1 1
  • 关于时区的时间的详解,比如UTC\GMT等

    来源 UTC 和 GMT 及 北京时间的关系 UTC和GMT 这两者几乎是同一概念 它们都是指的格林尼治标准时间 只不过UTC的称呼更为正式一点 两者的区别在于前者是一个天文 上的概念 而 后者是基于一个原子钟 在UTC中 每一年或两年会有
  • 移植micropython最小工程到mm32f3270微控制器

    移植micropython最小工程到mm32f3270微控制器 苏勇 2021 08 文章目录 移植micropython最小工程到mm32f3270微控制器 Introduction 初试micropython v1 6 增加MM32的移
  • OpenCV图像梯度(Sobel和Scharr)

    OpenCV图像梯度 Sobel和Scharr 1 图像梯度是什么 2 图像梯度的用途 3 图像梯度的使用 参考 这篇博客将介绍图像渐变以及如何使用OpenCV的cv2 Sobel计算Sobel渐变和Scharr渐变 1 图像梯度是什么 图
  • CMake - 使用 target_sources() 提高源文件处理能力

    翻译自https crascit com 2016 01 31 enhanced source file handling with target sources 使用 target sources 提高源文件处理能力 在CMake项目中
  • JDK8源码阅读(三) java.io.Serializable

    一 类 1 1 类修饰符 A 是一个接口 B 类的可序列化性由实现java io serializable接口的类启用 不实现此接口的类将不具有序列化或反序列化的任何状态 可序列化类的所有子类型本身都是可序列化的 序列化接口没有方法或字段
  • 数据结构——单链表OJ题

    单链表OJ题 前言 一 删除链表中等于给定值 val 的所有节点 二 反转一个单链表 三 返回链表的中间结点 四 输出该链表中倒数第k个结点 五 将两个有序链表合并 六 链表的回文结构 七 将链表分割成两部分 八 找出第一个公共结点 九 判
  • Matlab:交叉验证,索引结果重现,打乱数据

    总会有奇奇怪怪的想法和需求 想要产生的交叉验证的索引可以重现 虽然可以采取保存的方式 目录 一 随机选取 1 产生索引 2 调用数据 打乱数据 二 顺序选择 循环选取 1 数据初始化 样本个数 训练样本个数等 2 产生训练数据的索引 3 存
  • 多线程编程warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 错误解决

    在多线程编程中使用 thread start pthread t thread id THREAD BODY thread workbody void thread arg 创建子线程时因为最后一个参数需要是指向子线程的文件描述符 int类
  • 使用axis2 java2wsdl命令生成wsdl文件

    1 eclipse新建web工程 编写service接口方法 2 axis2环境变量配置 必须配置环境变量 否则执行java2wsdl命令时无法识别路径 如下 新建环境变量 AXIS2 HOME 值为axis2解压路径如 I path ja
  • vim常用配置及ideavim插件静音

    更多详细内容见文章 http www shanxing top p 188http www shanxing top p 188 提示音静音 set noerrorbells set visualbell 语法高亮 syntax enabl
  • Linux USB U盘热插拔挂载和卸载

    一 硬件平台 1 控制器 MT7620 A9内核 2 RTC芯片 MCP7940 二 软件平台 1 开发环境 Ubuntu12 04 2 SDK内核包 MT7620 SDK软件开发包 MediaTek ApSoC SDK 4320 2015
  • Ubuntu 18.04 VScode 使用php-debug插件

    1 安装xdebug 安装 php dev apt get install php7 X dev autoconf automake 复制代码 上面的7 X请改成对应的php版本号 不然默认会下载php最新的版本 使用对应的 xdebug
  • python运算符

    算术运算符 以下假设变量 a 10 b 20 加 两个对象相加 a b 输出结果 30 减 得到负数或是一个数减去另一个数 a b 输出结果 10 乘 两个数相乘或是返回一个被重复若干次的字符串 a b 输出结果 200 除 x除以y b
  • python matplotlib数据可视化案例-生成柱状图,饼图(扇形图),词云。

    目前python spark scala十分火爆 于是我就利用爬虫将猎聘上的招聘信息进行了一下获取 相比起来 猎聘上的职位数量还是很多的 3中技术类型以 python spark scala 作为关键词 一共爬取了一万多条信息 爬取的主要信