
上QQ阅读APP看本书,新人免费读10天
设备和账号都新为新人
1.2 前端渲染工具的安装和启动方法
尽管Altair在non-Notebook环境下也可以运行,例如Altair Viewer,但是Notebook提供的交互式编辑查看环境非常有利于使用Altair探索数据、认识数据和理解数据,同时,也可以更好地理解Altair的声明式统计可视化的设计理念。因此,Altair最好在Jupyter Notebook、JupyterLab或nteract中运行。由于本书的示例代码都是在Jupyter Notebook中运行的,所以下面重点介绍Jupyter Notebook和JupyterLab的安装及启动方法。
说明:本书出现的命令提示符“>>>”表示代码实现部分是在Python的交互式解释器中完成的,可以交互式查看代码运行结果。在本书中,没有命令提示符“>>>”的代码实现部分,表示所有操作均在Jupyter Notebook或JupyterLab中完成。
1.2.1 Jupyter Notebook的安装和启动方法
Jupyter Notebook可以使用pip或conda安装,使用pip安装Notebook的代码如下所示。

使用包管理器conda安装Notebook的代码如下所示。

成功安装之后,在终端(Linux/Mac)或命令提示符(Windows)下,运行命令jupyter notebook启动Notebook。
1.2.2 JupyterLab的安装和启动方法
JupyterLab可以使用pip或conda安装。使用pip安装JupyterLab的代码如下所示。

使用包管理器conda安装JupyterLab的代码如下所示。

成功安装之后,在终端(Linux/Mac)或命令提示符(Windows)下,使用命令jupyter-lab启动JupyterLab。