最近参与了一些数据分析的微课堂了解学习,接触了几个工具,记录如下:
先来了解一下Jupyter百科的简介
Jupyter Notebook(此前被称为 IPython notebook)是一个交互式笔记本,支持运行 40 多种编程语言。
Jupyter Notebook 的本质是一个 Web 应用程序,便于创建和共享程序文档,支持实时代码,数学方程,可视化和 markdown。 用途包括:数据清理和转换,数值模拟,统计建模,机器学习等等
简单理解是:可以直接用于运行python代码的环境
MAC 环境下安装命令如下:
pip3 install --upgrade --force-reinstall --no-cache-dir jupyter #如果是pip2的,则注意对应修改一下命令
遇到报错
报错内容如下
#以下是报错信息
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
djangorestframework-stubs 1.2.0 requires django-stubs>=1.3.0, which is not installed.
djangorestframework-stubs 1.2.0 requires mypy>=0.750, which is not installed.
celery-stubs 0.1.1 requires mypy>=0.720, which is not installed.
flower 0.9.3 requires tornado<6.0.0,>=4.2.0, but you have tornado 6.1 which is incompatible.
报错对应截图如下
有一些报错如上所示,但如果没用到那些库的,可以先不用处理
运行命令
jupyter notebook #在终端运行此命令
呈现类似如下截图,则表示运行成功:
操作 jupyter
-
运行以上命令之后,会自动调用浏览器,在浏览器中弹出 jupyter 的操作界面。
-
在界面右上角点击“新建”—“python3”,进入代码编辑页面
-
在这里就可以正常运行一些简单的python代码了,如下是制作简单的图表
简单代码如下
from pyecharts import Gauge
gauge = Gauge("可修改成你自己的内容") #仪表盘的标题
gauge.add("业务指标", "完成率", 99.99)
在生成的图表中,可通过图表右侧的下载按钮将图片下载到本地方便使用