当前位置:网站首页>Review of Weibo hot search in 2021 and analysis of hot search in the beginning of the year
Review of Weibo hot search in 2021 and analysis of hot search in the beginning of the year
2022-07-04 15:45:00 【The way of several people】
The way of several original articles , Please contact us for reprint
2022 The bell of the new year of the tiger is about to ring , Worked hard for a year , We are all looking forward to the reunion and joy of returning home , Wash away tiredness , Adjust the State , Vigorously continue the journey of the new year . But now the domestic defense line has been broken by Omicron , The new variant of the virus is threatening , The national defense has been broken in many areas, including first tier cities , This makes the travel policy of the Spring Festival more difficult to predict . I hope everyone can go home as desired , After a good year .
In the New Year , We might as well stop in a hurry , Look back on the past 2021 year , Look at what happened , What marks are left .
This time we use the data of Weibo search 2021 Review and analysis of hot events in and at the beginning of this year . The preparations before analysis will not be repeated , Refer to the previous data analysis article .
1
Hot search annual calendar heat distribution
Get all the hot search data last year , Summarize the heat value by date , In the form of calendar , Visual output heat search annual calendar heat distribution .
【 Code 】
# Get date list def get_date_list(start, end): date_list = [] start_dt = datetime.strptime(start, "%Y-%m-%d") end_dt = datetime.strptime(end, "%Y-%m-%d") while start_dt <= end_dt: date_list.append(start_dt.strftime("%Y-%m-%d")) start_dt = start_dt + timedelta(days=1) return date_list # Get hot search information def get_trend_topic(): # Specify the date range for hot search date_list = get_date_list("2021-01-01", "2021-12-31") topic = [] hotNumber = [] date = [] month = [] icon = [] durations = [] fenlei = [] # Crawl the hot search content of the specified date for i in range(0, len(date_list)): url = "url" + date_list[i] res = requests.get(url=url, headers=headers) res.encoding = "utf-8" trend = json.loads(res.text) trend = trend["data"] # Cycle through the information items of the hot search for j in range(0, len(trend)): try: topic.append(trend[j]["topic"]) hotNumber.append(trend[j]["hotNumber"]) date.append("20" + trend[j]["date"][0:8]) month.append("20" + trend[j]["date"][0:5]) icon.append(trend[j]["icon"]) durations.append(trend[j]["durations"]) fenlei.append(trend[j]["fenlei"]) except: print(trend[j]["date"]) continue # Set the interval between daily hot search requests time.sleep(0.5) # Create data table tb_trend = pd.DataFrame( {"topic": topic, "hotNumber": hotNumber, "date": date, "month": month, "icon": icon, "durations": durations, "fenlei": fenlei}) # Delete duplicate lines tb_trend = tb_trend.drop_duplicates() # Summarize the heat search heat value by date sum_hot = tb_trend.groupby("date", as_index=False)["hotNumber"].sum().values.tolist() # Data visualization output calendar(sum_hot, "2021 Annual hot search calendar distribution map ", "2021 Annual hot search calendar distribution map ")
【 result 】
chart 1:2021 Annual hot search calendar heat distribution
【 analysis 】
Hot search calendar , The distribution of heat value of heat search from late July to early August is the most concentrated , It may be due to the summer vacation and the Tokyo Olympic Games ; January and the end of the year have the lowest popularity , But in 11 month 17 A small outbreak of low heat and hot search season suddenly appeared on the th .
2
The hottest day is hot
Search the heat calendar chart above , You can see ,2021 The highest heat value of the annual hot search is in July , It means that the hot search in July is the most intensive . among , The hottest day is 7 month 29 Japan .
We extract 7 month 29 The data of , Look at what everyone was talking about that day .
【 result 】
chart 2:2021 The annual hot search is the highest a few days ago 15 Big talk
【 analysis 】
After extracting the data of the hottest day , Summarize the heat value according to the topic of the day , And sort , You can get the hottest topic of the day .
The topic of seeing the hottest day basically revolves around the war situation of the Chinese team in the Tokyo Olympic Games . And the first topic is “ Lin Dan's most admired opponent is Li Zongwei ”, Very positive energy topic . This topic is really hot , Become the year Top1 topic of conversation . so , How valuable is the great friendship between Lin Dan and Li Zongwei who fell in love and killed each other on the badminton court , Li Zongwei's strength and hard work have brought great impact to Lin Dan .
3
Monthly top ten hot searches
Get all the hot search data last year , Summarize the heat value by month and topic , Through the form of pie chart , Top ten topics of visual output hot search month .
【 Code 】
# Summarize the heat of search by month sum_hot_mth_top = tb_trend.groupby(["topic", "month"], as_index=False)["hotNumber"].sum() sum_hot_mth_top = sum_hot_mth_top.sort_values("hotNumber", ascending=False) # Extract the top ten topics of monthly hot search by month for mth in month_list: sum_hot_mth_top_new = sum_hot_mth_top[sum_hot_mth_top["month"] == mth] name = sum_hot_mth_top_new["topic"].head(10).to_list() value = sum_hot_mth_top_new["hotNumber"].head(10).to_list() # Data visualization output pie(name, value, mth + " Before the hot moon 10", mth + " Before the hot moon 10")
【 result 】
chart 3:2021 Ten hot topics in December (1-12 Monthly rotation )
video :2021 Ten hot topics in December ( Duration 35 second )
【 analysis 】
2021 The top ten topics of the monthly hot search every month in can reflect the major hot events of the month , Now, Hao Hao will take you to review .
- 1 month : Weiya's new year goods hit the first shot of the new year ; Riding the wind and waves, the second season of my sister's broadcast attracted heated discussion
- 2 month : Around the news of the death of two heavyweights in the entertainment industry : headmaster 、 Zhao Yingjun ; Celebrate the new year of the ox
- 3 month : Discussion on new energy vehicle manufacturing forces ; Three TV dramas that have long dominated search have been broadcast ; Xinjiang cotton incident
- 4 month : The divorce of first-line artists is still the focus of public attention ; The creation camp starts broadcasting ; The Chinese women's football team qualified for the Olympic Games
- 5 month : The same day in China 、 At the same time , Lost two great scientists 、 academician : Yuan Longping 、 Wu Mengchao ; The three child policy is coming
- 6 month : College entrance examination month ; Guangzhou is suffering from the epidemic of covid-19 ; The Shenzhou 12 manned spacecraft was successfully launched
- 7 month : Two world badminton giants sympathize with each other ; Wu Yifan's entanglement with Du Meizhu ; Henan suffered a heavy rainstorm once in a thousand years ; The war situation of Tokyo Olympic Games
- 8 month : Wu Yifan and the Tokyo Olympic Games occupied a hot search all month ; Su Bingtian ran out “ The first flying man in Asia ” The title of
- 9 month : Meng Wanzhou was released to return home ; Commemoration of the September 18th Incident ; Local epidemic situation ;Netflix New phenomenal drama 《 Squid game 》
- 10 month : Li Yundi was arrested and aroused heated discussion about prostitution ; National Day
- 11 month :EDG Won the champion of E-sports global finals ; The third historical resolution of the Communist Party of China ; The head anchor was fined for tax evasion
- 12 month : Weiya was punished and banned for tax evasion ( It really echoes ); The connotation of high-quality development is hot ; This year, many stars chose to call the police after being rumored ; Huo Zun incident reversed
Of course , Some hot events that are still fresh in your memory did not appear in the monthly hot search , It may be because it spans two months , Cause its weight to drop .
4
Hot topics of the year
Get all the hot search data last year , Summarize the heat value by topic , Through the form of histogram , Visual output hot search before the year 15 Big talk .
【 Code 】
# Summarize the annual search popularity by topic sum_hot_year_top = tb_trend.groupby("topic", as_index=False)["hotNumber"].sum() sum_hot_year_top = sum_hot_year_top.sort_values("hotNumber", ascending=False) name_year_hot = sum_hot_year_top["topic"].head(15).to_list() value_year_hot = sum_hot_year_top["hotNumber"].head(15).to_list() # Data visualization output bars_non_slider2(name_year_hot, value_year_hot, "2021 The hottest topic of the annual hot search ", "2021 The hottest topic of the annual hot search ")
【 result 】
chart 4:2021 Before the annual hot search 15 Big talk
【 analysis 】
“ Lin Dan's most admired opponent is Li Zongwei ” The topic leads the annual hot search list with its popularity . Next, Wu Yifan was arrested for sexual assault and grandpa Yuan Longping died . These two feel very awkward together , And one of China's greatest scientists has less attention than a traffic star , It really makes people feel sad .
Most of the top 15 in the annual hot search are entertainers 、 Negative news from stars ( It's not too much to call this year the year of collective collapse of entertainment stars ) And the TV series 、 variety show ; There are other epidemics 、 Rainstorm and other social hot news ; Grandpa yuanlongping occupied two annual hot searches .
5
The longest hot search on the list
Get all the hot search data last year , Summarize the duration value on the list by topic , Through the form of histogram , Visual output is the longest time before the annual Top Search 15 Big talk .
【 Code 】
# Summarize the duration of hot search on the list by topic sum_duration = tb_trend.groupby("topic", as_index=False)["durations"].sum() sum_duration = sum_duration.sort_values("durations", ascending=False) name = sum_duration["topic"].head(15).to_list() value = sum_duration["durations"].head(15).to_list() # Data visualization output bars_non_slider(name, value, "2021 The annual hot search is ahead of the list 15", "2021 The annual hot search is ahead of the list 15")
【 result 】
chart 5:2021 The annual hot search list has a long history 15 Big talk
【 analysis 】
2021 The topics that have been popular on Weibo for the longest time are basically TV dramas and variety shows . It seems that TV dramas and variety shows are popular through purchase , Use the popularity of hot search for publicity , It has become a routine operation .
The fund is the only one who has been dominating the list for a long time 15 China is not the topic of TV variety , And ranked fifth , It seems that the fund market last year was really green ( Once the fund is hot, it must be bad ).
6
Annual hot search category
Get all the hot search data last year , Summarize the heat value by topic category , Through the form of histogram , Visual output hot search before the year 15 Big question category .
【 Code 】
# Summarize the popularity of search by category sum_fenlei = tb_trend.groupby("fenlei", as_index=False)["hotNumber"].sum() sum_fenlei = sum_fenlei.sort_values("hotNumber", ascending=False) name_fenlei_hot = sum_fenlei["fenlei"].head(15).to_list() value_fenlei_hot = sum_fenlei["hotNumber"].head(15).to_list() # Data visualization output bars_non_slider2(name_fenlei_hot, value_fenlei_hot, "2021 Before the annual hot search category 15", "2021 Before the annual hot search category 15")
【 result 】
chart 6:2021 Before the annual hot search 15 Major categories
【 analysis 】
Social events are undoubtedly the most popular topics of the year , This kind of topic is much more popular than other categories . Entertainment topics ( Including stars 、 variety 、 TV play 、 Movies, etc. ) It also accounts for a considerable proportion of hot search . The rest is sports 、 current affairs 、 Finance and economics, 、 Internet and other topics related to the national economy and the people's livelihood .
7
Search for annual keywords
Get all the hot search data last year , Participle all topics , And eliminate the stop words , Count the word frequency of word segmentation , Through the form of word cloud , Visual output hot search annual keywords .
【 Code 】
# Separate and merge the hot search topics with commas , Convert to string seg = tb_trend["topic"].to_list() seg = ",".join(seg) # Word segmentation of hot search topics after merger seg_list = list(jieba.cut(seg)) seg_list_new = [] for m in range(0, len(seg_list)): if len(seg_list[m]) > 1 and is_number(seg_list[m]) == False: seg_list_new.append(seg_list[m]) # Count the word frequency of word segmentation results , And convert to tuples result = Counter(seg_list_new).items() # Data visualization output word_cloud(result, "2021 Annual hot search keywords ", "2021 Annual hot search keywords ")
【 result 】
chart 7:2021 Annual hot search keywords
【 analysis 】
The top keywords of the hot search year are basically related to the new crown ( Diagnosis 、 newly added 、 The vaccine 、 epidemic situation 、 novel coronavirus 、 Native land 、 Case 、 nucleic acid 、 Vaccination, etc ), so 2021 year , We are still struggling with novel coronavirus, which has been circulating around the world for nearly two years . At the same time, there are Olympic related keywords ,2021 year , We witnessed the first time in history that the Olympic Games were held in a non Olympic year .
These happy or sad keywords accompany us through a difficult but singing year .
8
2022 Hot search at the beginning of the year
Get all the hot search data this year , Summarize the heat value by topic , Through the form of histogram , The top ten topics of visual output search so far this year .
【 result 】
chart 8:2022 Ten hot topics in the new year
【 analysis 】
2022 Years has just opened , The new coronavirus Omicron variant broke through China's defense , And there are also studies that have shown that suffering from the new crown will cause irreversible damage to male sexual function ( It's appalling , I don't know if it's a foreign political trick , Force its people to vaccinate ).
President Xi's New Year greetings 、 The positive energy events such as the victory of Jiang GE's mother v. Liu Xin are 2022 A good start in the new year . May everyone have a bright future in the year of the tiger 、 Fruitful results , Beauty always accompanies !
Cover image source :unsplash
Cover picture author :Jan Baborák
边栏推荐
猜你喜欢
Understand Alibaba cloud's secret weapon "dragon architecture" in the article "science popularization talent"
MySQL学习笔记——数据类型(数值类型)
Analysis of nearly 100 million dollars stolen and horizon cross chain bridge attacked
在芯片高度集成的今天,绝大多数都是CMOS器件
C1 certification learning notes 3 -- Web Foundation
直播预告 | PostgreSQL 内核解读系列第二讲:PostgreSQL 体系结构
In today's highly integrated chips, most of them are CMOS devices
Unity animation day05
Understand the context in go language in an article
科研漫画 | 联系到被试后还需要做什么?
随机推荐
LeetCode 58. Length of the last word
暑期复习,一定要避免踩这些坑!
开源人张亮的 17 年成长路线,热爱才能坚持
科研漫画 | 联系到被试后还需要做什么?
找数字
%S format character
Detailed explanation of MySQL composite index (multi column index) use and optimization cases
Selenium element interaction
从0到1建设智能灰度数据体系:以vivo游戏中心为例
Unity script lifecycle day02
%F format character
直播预告 | PostgreSQL 内核解读系列第二讲:PostgreSQL 体系结构
JS tile data lookup leaf node
selenium 元素交互
MySQL学习笔记——数据类型(数值类型)
Force button brush question 01 (reverse linked list + sliding window +lru cache mechanism)
Width accuracy
MySQL learning notes - data type (numeric type)
Unity script API - GameObject game object, object object
Understand the context in go language in an article