Skip to main content

解决bar_chart_race无法显示中文的问题

Project description

bar_char_race_cn库

解决bar_chart_race库不支持中文的问题

安装

pip install bar_char_race_cn

注意:

使用前需提前安装ffmpeg

使用

请到github下载测试数据

import pandas as pd

df = pd.read_csv('data/财政收入.csv')

def year2timestamp(year):
    #转为可比较大小的日期格式
    return pd.Timestamp(str(year))

df['year'] = df['year'].apply(year2timestamp)
df.set_index('year', inplace=True)
df.sort_index(inplace=True) #日期从小到大排序
import bar_chart_race_cn as bcr

bcr.bar_chart_race(df=df,
                   filename='近20年各省财政收入.mp4',
                   title='近20年各省财政收入(单位: 亿元)'
                  )

更多

支持一下

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

bar_chart_race_cn-0.11-py3-none-any.whl (153.3 kB view details)

Uploaded Python 3

File details

Details for the file bar_chart_race_cn-0.11.macosx-10.9-x86_64.tar.gz.

File metadata

  • Download URL: bar_chart_race_cn-0.11.macosx-10.9-x86_64.tar.gz
  • Upload date:
  • Size: 296.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.5

File hashes

Hashes for bar_chart_race_cn-0.11.macosx-10.9-x86_64.tar.gz
Algorithm Hash digest
SHA256 a105cd1dda4713834c6a7efbeb8af29ee1840c7a48955c6fd0852628bc51ca5b
MD5 6b85d0036ce09dc56ca5c188ea0fb017
BLAKE2b-256 c0b7abbb9df66fadef7c05b32727cdd1967a6564872468586da178d984827f95

See more details on using hashes here.

File details

Details for the file bar_chart_race_cn-0.11-py3-none-any.whl.

File metadata

  • Download URL: bar_chart_race_cn-0.11-py3-none-any.whl
  • Upload date:
  • Size: 153.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.5

File hashes

Hashes for bar_chart_race_cn-0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 33c5bf53522bf2ea652bf58d336aae4ce466bf525cade51069cb9e445d0ce32c
MD5 bdba432af60b1824eae5fe37d3f0da09
BLAKE2b-256 28ebc3754eca3f643f78a08b564ab57a377d41e4729bd49dd2b3aa2c3d53e5ff

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page