Cloud Pak for Data

 View Only

How to use pyecharts plotting library in Cloud Pak for Data 3.5 hosted in a private cloud environment

By Harris Yang posted Tue February 23, 2021 01:21 AM

  

How to use pyecharts plotting library in Cloud Pak for Data 3.5 hosted in a private cloud environment

Table of Content
1. The problem
2. The environment definition
3. The instruction of pyecharts notebook environment definition
3.1 Prepare pyecharts package
3.2 Upload the downloaded pyecharts package into Cloud Pak for Data
3.3 Create pyecharts environment definition
3.4 New a notebook with the pyecharts environment definition
4. The summary

1. The problem
pyecharts (https://github.com/pyecharts/pyecharts) is a very useful open source plotting library and many data scientists and data engineers are using it for data exploration and visualization. IBM Cloud Pak for Data 3.5 preinstalled many open source python libraries including some very popular plotting libraries. If you want to plot charts in Jupyter notebooks with pyecharts in Cloud Pak for Data 3.5. The users can easily install it with pip install by following the instruction of pyecharts from https://github.com/pyecharts/pyecharts. In the daily business scenarios, many customer deployed IBM Cloud Pak for Data in their private cloud environment which means the entire Cloud Pak for Data is running in an isolated private network without internet connection. This blog provides the instruction on how to use pyecharts in Cloud Pak for Data 3.5 in a private cloud environment.

2. The environment definition
Jupyter notebook in IBM Cloud Pak for Data is associated with a environment defintion which defines the hardware and software configuration at running the notebook. Cloud Pak for Data 3.5 provides the default Jupyter notebook environment definitions for Python and R to quickly get started with notebooks, such as Default Python 3.7 and Default Python 3.6. Users can create custom notebook environment definitions to specify hardware and software configuration including specify additional open source libraries. In this blog, users can create a custom notebook environment definition to install pyecharts from a local package.

3. The instruction of pyecharts notebook environment definition
3.1 Prepare pyecharts package
Users can download the pycharts plotting library from a machine with internet connection by running the following commands.
pip download -d /project_data/data_asset/ pyecharts
The downloaded packages are these:


3.2 Upload the downloaded pyecharts package into Cloud Pak for Data
Log into the target analytics project in Cloud Pak for Data and add all the downloaded pyecharts package into the data assets

3.3 Create pyecharts environment definition
Go to the Environments tab and click New environment definition button to create environment definition.
Provide a name and specify the hardware configuration, then click Create button.
cpd3_5-pyecharts-new-env.png

On the pyecharts environment definition page, go to Customization section and click Create button.
cpd3_5-pyecharts-pyecharts-py37.png

Modify the pip install section and click Apply.
cpd3_5-pyecharts-customization.png

The update is the same operation of the following command line
pip install pyecharts --no-index --find-links="/project_data/data_asset"

3.4 New a notebook with the pyecharts environment definition
In the notebook, pyecharts plotting library is available to use for plotting and data exploration then.
cpd3_5-pyecharts-testnotebook.png

cpd3_5-pyecharts-testnotebook1.png

cpd3_5-pyecharts-testnotebook2.png

4. The summary
IBM Cloud Pak for Data 3.5 is an open and trusted AI platform for business users to develop AI solution in a secured environment, and its hybrid cloud infrastructure can support all the business scenarios in daily operation for enterprise. It makes the data analytics and AI more transparent to business operations and insights.


#CloudPakforDataGroup
0 comments
8 views

Permalink