current position:Home>Using Python to analyze 2,000 thousand confession walls of a university, I saw the secret of their divorce

Using Python to analyze 2,000 thousand confession walls of a university, I saw the secret of their divorce

2022-09-09 06:38:31happy planet no joy

good college days,It is a paradise for youth,From the heavy high school life to the colorful college life,Freed from a lot of shackles.Think back to college life,Everyone has some ignorant youth memories,Many friends must also know the confession wall of the university,Maybe you are still leaving a message on the confession wall or being confessed by others.

Now that I think about it, it's still very sweet?今天,I will lead you to use itPythonGrab a college confession wall,Relive fond memories of your college days.

01.数据获取

There are thousands of college confessions on the college confession wall page,You can choose any school to grab,Each school has its own confession wall homepage,Homepages belong to the category of static web pages,如下图所示:

In the picture above, we want to express the content of each page,We want to capture the names of the confessed and the confessor and the contents of the confession,核心代码如下:

由于网页属于静态网页,And there is no complicated anti-reptile means,Therefore, there is no particularly complicated content in the writing of the program,Programs use loops,Construct web links for each page,Then extract the information we want to get,Finally, the extracted information can be saved to a local file.

02.数据分析

这里,The editor grabbed the total of a certain college2512条confession information.Next, let's analyze the information obtained by grabbing it.

1).Who is the king of confession

Positive confessor,It represents a person's liking for a person,yearning for love,But in terms of expression,Often more shy,He did not want to reveal his real name.through the following procedure,Let's count the number of confessors,Take a look at everyone's signature information on the confession wall.

its visualization results,让人大跌眼镜,Everyone is so shy!

可以看到,超过93%The professors are treated anonymously,And among those with higher confession signatures,He didn't leave his real name.It can be seen that everyone is still very shy,I don't want to reveal my name.

2).Who is the star who has been confessed

A person can be confessed,It shows the excellence of a person,It's something to be proud of.We utilize histogram visualization,Let's see who is the star who is being confessed.The program and visualization results are shown in the figure below:

可以看到,Unlike the confessor,The names of those who were confessed were very diverse,And there are real personal names.

There are also people“经管”、“教育学院”Confession occurs.This situation may be the college of the person being confessed to or the confessor's confession to his own college.

3).Which college has been confessed the most

The more times you are confessed,To a certain extent, it shows that there are more beautiful and handsome men in the academy,This also points us in the direction of finding the object of confession,The editor remembers that when I was in college, the most beautiful women should be新闻系,Department of Media,反而电子,自动化,There are not many beauties in computer school.

上图程序中,First, use keyword matching to match different colleges,然后利用pyecharts下的LineClasses are displayed visually.

from the visualized results,可以看到,教育学院、School of Psychology and School of Economics and ManagementRanked in the top three in the number of confessed colleges,Students of this college can pay more attention to these colleges,You might find someone you like.

4.express keywords

最后,我们来看一下,Confession word cloud,Take a look at what keywords are in your statement.

可以看到,Everyone's confession word cloud,包含了“喜欢”、“我爱你”、“我们”等关键词.最后,Let's look at a few statements of confession.

  • But I saw your first glance,I felt familiar,直到后来我才明白,This is Yue Lao who brought the two of us together with a red thread,May you be well every day,It's sunny here for me.

  • 初次遇见,Silly and sweet you,Like a princess in a fairy tale.Every boy has a princess who longs to protect,And you are my princess.爱你!

  • Actually, I want to tell you a lot,We still need time to grow and settle,愿你天天开心!Love you, love you, love you for ten thousand years!

The above is the analysis and sharing of the confession wall brought to you by Xiaobian,In fact, if you like someone, you have to be brave and say it,Maybe the other party is waiting for a brave confession from you.

关于Python技术储备

学好 Python 不论是就业还是做副业赚钱都不错,但要学会 Python 还是要有一个学习规划.最后大家分享一份全套的 Python 学习资料,给那些想学习 Python 的小伙伴们一点帮助!

一、Python所有方向的学习路线

Python所有方向路线就是把Python常用的技术点做整理,形成各个领域的知识点汇总,它的用处就在于,你可以按照上面的知识点去找对应的学习资源,保证自己学得较为全面.

image

二、学习软件

工欲善其事必先利其器.学习Python常用的开发软件都在这里了,给大家节省了很多时间.

image

三、全套PDF电子书

书籍的好处就在于权威和体系健全,刚开始学习的时候你可以只看视频或者听某个人讲课,但等你学完之后,你觉得你掌握了,这时候建议还是得去看一下书籍,看权威技术书籍也是每个程序员必经之路.

image

四、入门学习视频

我们在看视频学习的时候,不能光动眼动脑不动手,比较科学的学习方法是在理解之后运用它们,这时候练手项目就很适合了.

image
image

四、实战案例

光学理论是没用的,要学会跟着一起敲,要动手实操,才能将自己的所学运用到实际当中去,这时候可以搞点实战案例来学习.

image

五、面试资料

我们学习Python必然是为了找到高薪的工作,下面这些面试题是来自阿里、腾讯、字节等一线互联网大厂最新的面试资料,并且有阿里大佬给出了权威的解答,刷完这一套面试资料相信大家都能找到满意的工作.

image
image

这份完整版的Python全套学习资料已经上传CSDN,朋友们如果需要可以微信扫描下方CSDN官方认证二维码免费领取【保证100%免费】.

copyright notice
author[happy planet no joy],Please bring the original link to reprint, thank you.
https://en.pythonmana.com/2022/252/202209090534072909.html

Random recommended