爬虫——jupyter环境的安装及使用

1.jupyter的简介

Jupyter Notebook是基于网页的用于交互计算的应用程序。其可被应用于全过程计算:开发、文档编写、运行代码和展示结果。

什么是Anaconda?

  • 集成环境:基于数据分析和机器学习的开发环境

jupyter:超级终端,就是Anaconda集成环境中提供的一种基于浏览器的可视化开发工具

2.jupyter的安装及使用

首先推荐大家把pip升级到最新的版本:

  • pip install --upgrade pip

安装Jupyter Notebook

  • pip install jupyter

启动jupyter

  • jupyter notebook

终端的显示页面

浏览器的显示页面:

如果有什么jupyter命令的问题:

  • jupyter notebook -help

指定端口启动:

  • jupyter notebook

启动服务器但打不开浏览器:

  • jupyter notebook --no-browser

3.jupyter的快捷键

普通指令

  1. 向上插入一个cell:a
  2. 向下插入一个cell:b
  3. 删除cell:x
  4. 将code切换成markdown:m
  5. 将markdown切换成code:y
  6. 运行cell:shift+enter
  7. 查看帮助文档:shift+tab
  8. 自动提示:tab

魔发指令

  1. 运行外部python源文件:%run xxx.py

  2. 计算statement的运行时间:%time statement

  3. 计算statement的平均运行时间:%timeit statement

  4. 测试多行代码的平均运行时间:

    %%timeit

    statement1

    statement2

    statement3

posted @ 2019-09-03 16:10  大栗  阅读(423)  评论(0编辑  收藏  举报
ヾ(≧O≦)〃嗷~