目录
一、python主流IDE(集成开发环境)对比
1、Pycharm
后台批处理、大中型项目的首选
- 在软件开发中,Jupyter可能显得并没有那么好用,这个模块化的功能反而会破坏掉程序的整体性;
- Pycharm它能对类、对象、关键字的补全和自动缩进,能格式化代码,定制代码片段和格式;
- Pycharm支持错误的突出显示,同时也包含PEP-8,能帮助写出整洁的代码,易于支撑其他语言。
2、Jupyter
交互式的首选,数据处理、分析、建模、观察结果、机器学习
- 拥有交互式组件,可以编程输出视频、图像、LaTaX。不仅如此,交互式组件能够用来实时可视化和操作数据;
- markdown 标记语言能够代码标注,用户能够将逻辑和思考写在笔记本中,这和python内部注释部分不同(同时还会让整个处理和建模的过程变得异常清晰);
- 模块化功能,能把大段的Python代码碎片化处理,分开每一段来运行。
二、Jupyter 介绍
Free software, open standards, and web services for interactive computing across all programming languages. 官网链接
1、版本
- Jupyter Notebook
The Jupyter Notebook is the original web application for creating and sharing computational documents. It offers a simple, streamlined, document-centric experience.
- JupyterLab(推荐)
JupyterLab is the latest web-based interactive development environment for notebooks, code, and data. Its flexible interface allows users to configure and arrange workflows in data science, scientific computing, computational journalism, and machine learning. A modular design invites extensions to expand and enrich functionality.
从官方对于Jupyter Notebook、JupyterLab的介绍以及自己在实际使用过程中两个版本的优弊,更推荐使用JupyterLab。当然由于JupyterLab在利用ipywidget交互式会有报错的可能,因此,如果用到ipywidget时,可切换到jupyter notebook中使用。
2、模式
Jupyter支持两种模式:
- 编辑模式(Enter):命令模式下回车Enter或鼠标双击cell进入编辑模式;可以操作cell内文本或代码,剪切/复制/粘贴移动等操作。
- 命令模式(Esc):按Esc退出编辑,进入命令模式;可以操作cell单元本身进行剪切/复制/粘贴/移动等操作。
3、支持视频、网页、图片、音频、数学公式等的显示
3.1 网页
from IPython.display import HTML, Video, Image, IFrame
IFrame('https://blog.csdn.net/', width=1000, height=600)
3.2 图片
from IPython.display import HTML, Video, Image, IFrame
Image('https://lmg.jj20.com/up/allimg/1114/020R1102553/21020Q02553-2-1200.jpg')
3.3 数学公式
J α ( x ) = ∑ m = 0 ∞ ( − 1 ) m m ! Γ ( m + α + 1 ) ( x 2 ) 2 m + α ,行内公式示例 J_\alpha(x) = \sum_{m=0}^\infty \frac{(-1)^m}{m! \Gamma (m + \alpha + 1)} {\left({ \frac{x}{2} }\right)}^{2m + \alpha} \text {,行内公式示例} Jα(x)=m=0∑∞m!Γ(m+α+1)(−1)m(2x)2m+α,行内公式示例
3.4 Markdown
丰富的、轻量的标记语言
无序列表
- 无序列表1
- 无序列表1-1
- 无序列表1-1-1
- 无序列表1-1
- 无序列表2
- 无序列表3
有序列表
- 1111
- 1111-1
- 1111-1-1
- 1111-1
- 2222
- 3333
链接