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 draw the changing History of Local Fiscal Revenue in the past 20 years

2025-02-24 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 draw the history of local fiscal revenue changes in the past 20 years. The editor thinks it is very practical, so I share it with you. I hope you can get something after reading this article. Without saying much, let's take a look.

Bar_char_race_cn library solution

The problem that the bar_chart_race library does not support Chinese

Install pip install bar_char_race_cn

Note:

Ffmpeg should be installed in advance before use.

Use

Prepare test data

Import pandas as pd

Df = pd.read_csv ('data/ Revenue .csv')

Def year2timestamp (year):

# convert to date format of comparable size

Return pd.Timestamp (str (year))

Df ['year'] = df [' year'] .apply (year2timestamp)

Df.set_index ('year', inplace=True)

Df.sort_index (inplace=True) # sort dates from smallest to largest

Visual code

Import bar_chart_race_cn as bcr

Bcr.bar_chart_race (df=df

Filename=' provincial financial revenue in the past 20 years. MP4'

Title=' provincial revenue in the past 20 years (unit: 100 million yuan)'

)

Effect.

A small case study of previous articles: Pandas's apply method

Quick introduction to Python Grammar Python Web crawlers and text data Analysis after reading this article you will understand what is the application of text analysis in the field of economics and management: the application of text analysis in marketing research look at the partisan tendencies of journalists' manuscripts from their Twitter concerns?

Pandas time series data operation 70g regular expression shreport library for text data cleaning of listed companies: batch download methods and techniques for improving the performance of Numpy and Pandas of listed companies on the Shanghai Stock Exchange ~ pandas can seamlessly connect BokehYelpDaset: hotel management data set 10g half an hour to learn Markdown markup syntax

The above is how to use Python to draw the history of local fiscal revenue changes in the past 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