Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Python to make a dynamic ranking of programming languages for 20 years

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article is about how to use Python to do a 20-year dynamic ranking of programming languages. I think it is very practical, so I share it with you. I hope you can get something after reading this article. Let's take a look at it.

On the stage of programming languages, there has always been a competition for who is the best language. Although editors have been using several programming languages, they feel that personal ideas can not represent everyone's ideas. Although the debate about the best languages has never stopped, we can explore the hot ranking of programming languages from the ranking of TIOBE programming languages.

Today, the editor will take a look at the changes in programming languages on the TIOBE programming language list since May 2001 to see how the popularity of programming languages has changed in the past 20 years.

01. Programming language data acquisition

First of all, what we do is to obtain the data. When we open the link https://www.tiobe.com/tiobe-index/, we can see the ranking of the TIOBE programming language. By looking at its web page source code, we can find that the data we want to crawl is displayed in the web page source code, as shown in the following figure:

Next, we can directly use the crawler to obtain the web page source code, and use regular expressions to match the keyword content we need. Some of the programs are shown below:

In the above program, we do regular expression matching for the captured data, then extract the heat values of each programming language in different periods of time, and save them to the local file.

02. Cleaning data

Next, what we need to do is to use a dynamic visual bar chart to observe the heat changes of various programming languages over time. Let's first clean the data, get the name of the programming language and set up a nested dictionary, as shown in the following figure:

The nested dictionary in the above program means the calorific value of each programming language under each month, and its structure format is as follows:

{"2020-1-12": {"Java": 16, "C++": 14, "python": 10, … }, "2020-2-13": {"Java": 16.3, "C++": 15.6,... }, } .

03. Set the color of the bar chart

In order to distinguish each programming language during visualization, you need to set a different color for each column in the column chart, and sort the nested dictionaries by month, as follows:

04. Done, dynamic display

Finally, we can visually display the data, as shown in the following figure:

In the above program, we first need to clear the active axis in figure. For each month of the nested dictionary, we sort the programming language in each month according to its heat value from small to large, and then associate the programming language of the sorting number with its corresponding histogram color.

05. Dynamic reality map

Next, we can draw our bar chart, then pause the display of the results and loop continuously to achieve the function of dynamic bar chart, as shown in the following figure:

06. A cooler dynamic graph

If you think the picture is not beautiful enough, you can use js to render the data. Here, the editor also creates a more beautiful interface for you using Flourish, as shown in the following figure:

As can be seen from the visual dynamic chart above, Java and C language have always been firmly in control of the top two hot spots of programming languages, while python language, with the upsurge of artificial intelligence, gradually chased from the bottom of the list to the third place, and gradually widened the gap with the fourth place, which can be described as the counterattack king of the programming language world.

However, like C++ and PHP, the fever is gradually decreasing. Although the popularity of programming languages is high and low, it is undeniable that every programming language has its application value and can go through baptism in the long history of programming languages without being eliminated. As long as you master a language well, you will have the opportunity to show your talents.

The above is how to use Python to make a dynamic ranking of programming languages for 20 years. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report