Powerful Visualization Using Python: Pyecharts (Code Included)

T Z J Y
CodeX
Published in
4 min readOct 19, 2021

--

Most serious data scientists prefer R to Python, but if you work on production in data science or machine learning, you’re probably going to have to put your partiality to R aside. In fact, there has been years of debate whether people should use R or Python.

Historically R has had a wider variety of packages for statistical analysis and visualisation. However, recently I start to use Pyecharts and feel it is fantastic building interactive charts.

What is Pyecharts?

Pyecharts is a library to generate charts using Echarts. It simply provides the interface between Echarts and Python. The visualisations work just like any R plots within Jupyter Notebook. Here are a few examples, and many more can be found from Pyecharts Gallery!

from pyecharts import options as opts
from pyecharts.charts import Liquid, Page
from pyecharts.globals import SymbolType
def liquid() -> Liquid:
c = (
Liquid()
.add("lq", [0.78, 0.60, 0.15, 0.05])
.set_global_opts(title_opts=opts.TitleOpts(title="Liquid"))
)
return c
liquid().render_notebook()

--

--

T Z J Y
CodeX
Writer for

Quantitative Research | Data Sciences Enthusiast