ticket? jobs? Object? Python elegant teach you to solve three major problems of the year!

Author | data does not brag

Recently, many of my friends have been many days immersed in the forthcoming (have) a holiday pleasure, incarnation fisherman, dedicated to fishing in troubled waters.

but! You really ready New Year Well! Do you really know why the New Year is called the year is it?

So that small Z to give you a story, Once there was a beast, a spring festival on ....

Sorry! Wrong studio, and all 2020, and the New Year was called the year, not because young people of East and West drift home for the holiday, there are always three is not open around the problem:

  • The right to buy tickets yet?

  • Your professional / work in the end is Gansha? How much pay?

  • You object?

The right ticket, by single years of hand speed, rush tickets indomitable perseverance, and that the situation in the centuries do not speak of friends help link a mass insight into the situation in the run, grab a large probability is no problem.

To solve the ticket, the mind has emerged, with a smile looking back two screens relatives face problems.

Fortunately, we all know from childhood, never failing think saying!

"Standing on the shoulders of our predecessors point of view the problem, on the height, I have a large portion of children can be higher than his" famous words (small Z nonsense), it gave me endless inspiration.

Speaking shoulders of our predecessors, know almost not that a great frame of reference it? So, we know almost Python crawling up on Hot-related issues:

Take a look at how many people have similar confusion, more importantly, what can be used to ready to use cheats.

Almost crawling known portion following code, attached to the end of the complete code and text data, skipping does not affect the reading.

import pandas as pd
import numpy as np
import os
import json
import requests

def parse_page(url,headers):
    html  = requests.get(url,headers = headers)
    bs = json.loads(html.text)
    result = pd.DataFrame()
    for i in bs['data']:
        headline = i['author']['headline'] #签名
        gender = i['author']['gender']  #性别
        user_type =  i['author']['user_type']
        user_id =  i['author']['id']
        user_token = i['author']['url_token']
        follwer_count = i['author']['follower_count'] #关注人数
        name = i['author']['name']   #用户昵称
        vote_up = i['voteup_count']  #点赞数
        updated_time = i['updated_time']    #更新时间
        title = i['question']['title']   #问题
        created_time = i['created_time'] #创建时间
        comment_count = i['comment_count'] #评论数
        can_comment = i['can_comment']['status']   #是否可以评论
        content = i['content']  #内容,还需要再清洗
        cache = pd.DataFrame({'用户ID':[user_id],'用户名':[name],'性别':[gender],'token':[user_token],'用户类型':[user_type],'签名':[headline],
                              '被关注人数':[follwer_count],'创建时间':[created_time],'更新时间':[updated_time],'评论数':[comment_count],
                              '点赞数':[vote_up],'是否可以评论':[can_comment],'内容':[content],'问题':[title]})
        result = pd.concat([result,cache])
    return result

A rainy day, or afterwards Tucao?

We found that "New Year back home, relatives ask is doing the work, to say the truth?" This issue, most of them with their own experiences to Tucao.

Should be the phrase "Tucao not avoid pro" the old saying, 91.68 percent of users do not have anonymous, of course, may not be aware of relatives Sounds almost.

Unknown Gender user too much, the proportion of men and women from the only point of view, it seems that the will of the male Tucao stronger.

Then, even more interesting answer came time distribution:

February 2018 No. (small years ago one day) 7, the main problem proactive know almost thrown at the problem, there are 15 enthusiastic people initiate the same day, in a small (No. 8) peaked add 68 days to answer .

However, after the 9th year is getting closer, answer a few less and less, after the February 15 New Year's Eve, New respondents disappeared, does everybody ready? But this is more likely to know almost traffic and distribution related.

问题沉寂了一年之后,热度在19年2月9日(大年初五)一飞冲天,221个热乎的回答蹭蹭涌入,事后吐槽之密集,以身手敏捷著称的七大姑八大姨都没能躲过。

但是,初五的辉煌,初六没能承接上,初七之后更是回归平淡。这个回答,今年还会不会再蹦跶呢?

“搞互联网好啊!正好我家网连不上!

我们继续扒一扒,上个问题回答者从事行业和岗位的秘密。

必须先吐槽一下大家填信息实在是太随心所欲了,让人清洗的头大。

行业写的都还挺规范,而涉及到学校和岗位,几百个回答下竟然几乎没有重样的!

“摸鱼情感教育”是什么岗位?学校填“哈尔滨佛学院”的是哈佛吗?工作写“讨饭XX年”的朋友是认真的吗!

得,我们先勉强看一下行业TOP10:

不得不说,互联网+计算机软件行业真乃吐槽双壁(占比和平台也有关系),两者合计占比超过59%,傲视群雄。

“产品经理?毕业就当了经理!能不能给你外甥走个后门啊!”

“数据分析?嗨呀,帮我分析分析下一期彩票!”

“做IT的?我的路由器出了点问题来帮我敲敲!”

“设计?广告设计?广告这些东西可真招人烦啊!”

互联网的发展大大超出了老一代人的想象,有朋友总结出来一个经验,亲戚说啥就是啥,不要解释,越描越黑。毕竟,最重要的还是开心嘛。

“现在能挣多少啊?

工资是一个严峻的话题。

一旦疏忽,父母面上无光,稍有不慎,又扫了七大姑八大姨的兴致。

综合点赞和回答数据,我们做了一个加权排序,排除炮灰答案后,逐字审读,悟出了三个大招。

1、乾坤大挪移

这一招的宗旨很简单,任何话题都是可以转移的。

“小Z,工资多少啊?”

“阿姨,工资这点小事等会说,我给你说说我今年搞的几个有意思的分析,您一定感兴趣!”

一个小时后,阿姨已经忘了当初的问题。

2、惜字如金

“小Z,工资多少啊?”

“尚可!”

“到底是多少啊?”

“够吃”

3、巧用同比

“小Z,工资多少啊?”

“有进步,比去年高15%呢”

“去年多少啊?”

“比前年高10%呢!”

“你对象呢?

由于非单身狗回答过于复杂和困难,此回答主要适用于单身狗。

由于此问题过于八卦且能无限延展,此回答亦不能用常规解法。

这天,你正要开黑,远方的七舅老爷推门而入。

“你对象呢?”

“啊!这个问题超纲了啊!是我的知识盲区了!”

“有还是没有!”

“有有有,别急嘛”,你打开了抽屉,拿出棋盘。

“你玩儿我呢!”

“哪敢哪敢哪敢,对象照片在我电脑上呢!”

说着,你打开了电脑,但手一刻也没有在相册逗留,而是径直冲向了一个py文件,打开了编辑器,在被锤倒之前,无比清晰的记得那个文件最后几行代码:

注:上述代码无限打印“对象”两个字,本文完整代码和源数据,后台回复“知乎过年”即可获取。

只一瞬,什么国民老公,什么后宫佳丽三千人,论对象数量,他们都还只是个弟弟。

热 文 推 荐 

“全栈开发已死?”

离开北上广,在二线城市做互联网的这一年 | 程序员有话说

2019,燃烧的中国开源年

20 万台 QQ 服务器全面上云!

集五福,我用Python

如何打造“智能助理”?阿里对话开发平台这样做

好扑科技技术副总裁戎朋:从海豚浏览器技术负责人到区块链,揭秘区块链技术之路

你点的每个“在看”,我都认真当成了喜欢

发布了456 篇原创文章 · 获赞 1万+ · 访问量 462万+

Guess you like

Origin blog.csdn.net/csdnsevenn/article/details/104047153