提交 4ee2bae4 编写于 作者: Miykael_xxm's avatar Miykael_xxm 🚴

update

上级 600c9962
.ipynb_checkpoints/
scipy2018-jupyterlab-tutorial/*
scipy2018-jupyterlab-tutorial/
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "ca778a64-5aa5-4ce5-9c8a-caf23dd3b869",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.1"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
......@@ -43,6 +43,18 @@
"4. 用 `jupyter lab` 命令启动 `jupyterlab`\n",
"5. 在 jupyterlab web 界面中选择语言为 `中文(简体,中国)`即可\n"
]
},
{
"cell_type": "markdown",
"id": "bde40818-5387-4c22-9bd6-c806f16e1bda",
"metadata": {},
"source": [
"## 带端口启动 Jupyter Notebook\n",
"\n",
"```bash\n",
"jupyter notebook --port 9999\n",
"```"
]
}
],
"metadata": {
......
......@@ -10,10 +10,18 @@
},
{
"cell_type": "code",
"execution_count": null,
"id": "2ff3d4c5-4372-4240-a2a3-e58428efb12d",
"execution_count": 8,
"id": "a37a146d-4106-4249-93c6-1dd4f376ae15",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"xxm\n"
]
}
],
"source": [
"list = [\"xxm\",\"miykael\",\"rose\",\"happy\"]\n",
"\n",
......@@ -22,12 +30,21 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"id": "7d8ddfa7-24fb-4983-be50-a9dd925ce1c5",
"metadata": {
"tags": []
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"72\n",
"72.0\n"
]
}
],
"source": [
"a = 2;\n",
"b = 20;\n",
......@@ -55,12 +72,17 @@
{
"cell_type": "markdown",
"id": "93c6b037-12cd-4ca7-9958-200c6cde402b",
"metadata": {},
"metadata": {
"tags": []
},
"source": [
"## JuypterLab 快捷键\n",
"\n",
"Jupyter Notebook 有两种键盘输入模式。编辑模式,允许你往单元中键入代码或文本;这时的单元框线是绿色的。命令模式,键盘输入运行程序命令;这时的单元框线是灰色。\n",
"\n",
"官方视频介绍 <https://jupyterlab.readthedocs.io/en/latest/user/interface.html#keyboard-shortcuts>\n",
"\n",
"\n",
"- `命令模式` (按键 Esc 开启)\n",
"- `Enter` : 转入编辑模式\n",
"- `Shift-Enter` : 运行本单元,选中下个单元\n",
......
{
"cells": [
{
"cell_type": "markdown",
"id": "82381445-63e3-4177-8dac-d27d9b0d1a49",
"metadata": {},
"source": [
"# 关于 Jupyter Notebook\n",
"\n",
"以下内容摘自 [Getting Started wiht JuypterLab(Beginner Level) | SciPy 2018 Tutorial | Jason Grout](https://www.youtube.com/watch?v=Gzun8PpyBCo)\n",
"\n",
"## Jupyter Notebook 特点\n",
"\n",
"> ## Interactive, Exploratory, Reproducible\n",
"> - Interactive, browser-based computing environment\n",
"> - Exploratory data science, ML, visualization, analysis, stats\n",
"> - Reproducible document format:\n",
"> - Code\n",
"> - Narrative text (markdown)\n",
"> - Equations (LaTex)\n",
"> - Images, visualizations\n",
"> - Over 100 programming languages\n",
"> - Everything open source (BSD License)\n",
"\n",
"\n",
"- Interactive / 交互式,基于浏览器的交互式计算环境,可以在 notebook 中直接交互,不需要跑到某个特定的生产环境上(但需要能够连接)\n",
"- Exploratoy / 探索式,数据科学和科学计算工具,交互式的探索数据\n",
"- Reproducible / 可复用,是一种非常便于分享的文档格式(包含代码、叙述性文字、公式以及图片/图形等)\n",
"\n",
"Jason 也列举了一些目前使用 Notebook 的场景:\n",
"\n",
"- 编写交互式教科书"
]
},
{
"cell_type": "markdown",
"id": "f691f636-2824-4975-aa06-bacc3551ab7d",
"metadata": {},
"source": [
"## Building Blocks(构建块)\n",
"\n",
"JupyterLab 的包含的构建块: \n",
"\n",
"- File Browser / 文件管理\n",
"- Notebooks / 笔记本\n",
"- Terminal / 终端\n",
"- Text Editor / 编辑器\n",
"- Kernels\n",
"- Output / 输出"
]
},
{
"cell_type": "markdown",
"id": "31f03849-3257-42ef-8f75-bdf1e1c44f52",
"metadata": {},
"source": [
"## 数据源\n",
"\n",
"### LIGO\n",
"\n",
"[LIGO Open Science Center](https://ligo.org/)\n",
"\n",
"用户可以在他们的 tutorail 中下载相关的科学数据进行探索,链接 <https://www.gw-openscience.org/tutorials/>\n",
"\n",
"### BuzzFeedNews\n",
"\n",
"<https://github.com/BuzzFeedNews>\n",
"\n",
"### O'Reilly\n",
"\n",
"- <>\n",
"- <https://www.oreilly.com/content/data-visualization-with-seaborn/>"
]
},
{
"cell_type": "markdown",
"id": "0dbdba83-f987-4b8b-808e-367d80542ce0",
"metadata": {
"tags": []
},
"source": [
"# JupyterLab VS Jupyter Notebook\n",
"\n",
"以下仅列举 JupyterLab 基于 Notebook 优化的内容部分:\n",
"\n",
"| 内容项 | JupyterLab | Jupyter Notebook | \n",
"| :-- | :--: | :--: |\n",
"| 可折叠输入/输出 | ✅ | ❌ |\n",
"| 可拖拽 cells | ✅ | ❌ |\n",
"| Notebook新视图 | ✅ | ❌ |\n",
"| 为 Notebook 新建 console | ✅ | ❌ |\n",
"| 为输出新建视图 | ✅ | ❌ |\n",
"\n",
"\n",
"> #### 关于优化部分的说明\n",
">\n",
"> **Notebook 新视图**\n",
"> 1. 你可以将其当做一个预览功能,实时的预览功能\n",
"> 2. 但其实他不仅仅是一个预览,这2个窗口(或者多个窗口)是同一个文件,并不是一个 copy ,并且允许这同一个文件两个窗口中的内容互相拖拽(实际上就是移动,比如将最底部的某个文件移动到最顶部)\n",
"> \n",
"> **右键新建 console**\n",
"> 1. 在线上的 JupyterLab & 本地的 JupyterLab 调试的时候,并没有出现 Demo 中的 Notebook 与 console 相互交互的效果;\n",
"> \n",
"> **为输出新建视图**\n",
"> 1. 为输出新建视图有一些很有意思的用法,可以直接当做 Dashboard 来使用\n",
"\n",
"\n",
"JupyterLab 支持用户在 Markdown 文件中通过选中代码部分并执行 `shift + enter`命令再新建的 `console` 中直接执行代码部分"
]
},
{
"cell_type": "markdown",
"id": "4910b0d8-db6d-4274-8d0f-ec1f9d3bffdd",
"metadata": {},
"source": [
"## JupyterLab 的文件查看功能\n",
"\n",
"JupyterLab 有着强大的文件查看功能(file viewer),但目前并未对其与 Jupyter Notebook 进行对比。支持包括:\n",
"\n",
"- Image (图像,支持包括 放大、缩小、水平/垂直翻转、反相等等),~Notebook 不支持~\n",
"- PDF\n",
"- geojson(地理数据格式),~Notebook 不支持~\n",
"- Vega Lite (可视化图形 json 格式),~Notebook 不支持~\n",
"- CSV (JupyterLab CSV针对于 Notebook 是一种全新的查看形式,2018年时官方称可以处理最大800M左右的 csv文件/ Safari&IE 可以处理 1.5G/ Firefox可以处理 200M,打开还非常的丝滑,并嘲笑了一番 excel),~Notebook 不支持~\n",
"- FASTA (基因组处理)\n",
"\n",
"JupyterLab 自身有着足够的可扩展性,允许用户定义自己的文件格式及文件查看器。\n",
"\n",
"在演示中,Jason 还提到了 QuantStack 为 JupyterLab 提供的 [DrawIO Diagram插件](https://github.com/QuantStack/jupyterlab-drawio),允许用户在 JupyterLab 中直接绘制流程图。"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.1"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
<mxGraphModel dx="620" dy="559" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" background="#ffffff"><root><mxCell id="0"/><mxCell id="1" parent="0"/><mxCell id="3" value="CSDN" style="shape=ext;double=1;whiteSpace=wrap;html=1;aspect=fixed;" vertex="1" parent="1"><mxGeometry x="240" y="590" width="80" height="80" as="geometry"/></mxCell><mxCell id="4" value="CODE&lt;div&gt;CHINA&lt;/div&gt;" style="shape=ext;double=1;whiteSpace=wrap;html=1;aspect=fixed;" vertex="1" parent="1"><mxGeometry x="414" y="590" width="80" height="80" as="geometry"/></mxCell><mxCell id="5" value="JupyterLab" style="shape=ext;double=1;whiteSpace=wrap;html=1;aspect=fixed;" vertex="1" parent="1"><mxGeometry x="590" y="590" width="80" height="80" as="geometry"/></mxCell><mxCell id="6" value="" style="endArrow=classic;startArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" edge="1" parent="1" source="3" target="4"><mxGeometry width="50" height="50" relative="1" as="geometry"><mxPoint x="240" y="740" as="sourcePoint"/><mxPoint x="290" y="690" as="targetPoint"/></mxGeometry></mxCell><mxCell id="7" value="" style="endArrow=classic;html=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" edge="1" parent="1" source="4" target="5"><mxGeometry width="50" height="50" relative="1" as="geometry"><mxPoint x="500" y="660" as="sourcePoint"/><mxPoint x="550" y="610" as="targetPoint"/></mxGeometry></mxCell></root></mxGraphModel>
\ No newline at end of file
......@@ -3,9 +3,43 @@
记录在目前使用 JupyterLab 过程中的一些问题:
1. 安装了中文语言包后 启用页 (Launcher)不显示任何内容,包括`console`,`notebook`,`terminal` 这些选项都看不见了
2.
# 一些有意思的功能
### 使用 terminal 进行 git 操作
当在本机使用了 JupyterLab 服务时,可以同时打开 `terminal`,然后在 terminal 中完成相关的 Git 操作,commit / push 等;
### 快捷键
- 像 复制、粘贴、剪切、撤销等常用操作, JupyterLab 使用时是没有 `ctrl/command` 键的;
- 像 关闭 某个标签页,为了避免和 浏览器的 `ctrl/command + w` 冲突,使用的是 `alt/option + w` 的方式
### 运行结果
.ipynb 的运行结果在点击运行之后,是会存储在 .ipynb 文件中的,并且这个文件可以被 `nbview` 查看。
### 插件支持
Jupyter 还支持插件的安装,进一步提升 Jupyter 的易用性。
### 右侧窗口的收起
单击(窗口已激活)/双击(窗口未激活)右侧菜单按钮 button ,就可以 toggle 窗口的显示/隐藏
### 论坛关于为什么没有开始使用 JuypterLab 的原因
参考链接 <https://discourse.jupyter.org/t/benefits-of-the-classic-ui-and-use-cases-for-classic-over-jupyterlab-was-why-is-tim-not-moving-to-lab/2419>
- 基于以上讨论形成的一个 wishlist <https://github.com/jupyterlab/jupyterlab/issues/7468>
### DrawIO 插件
在安装了 [DrawIO](https://github.com/QuantStack/jupyterlab-drawio) 插件后,JupyterLab 就是一个完全免费的 processon 工具,非常的牛批!
# 与 CODE CHINA 结合的点
......@@ -25,4 +59,19 @@
讨论的方式可以有:
1. 参考课程的反馈,为每个 `.ipynb` 文件新建一个 issue 作为讨论用的 issue ,相关的讨论都在该 issue 中进行;
2. 提交了 MR 的用户可以与项目作者在 MR 中进行讨论;
\ No newline at end of file
2. 提交了 MR 的用户可以与项目作者在 MR 中进行讨论;
### 展现形式
可以对特定的 项目 生成类似 pages 的页面,在对外宣传、推广的时候也是这种页面(比如 问答、博客中的链接),在这个页面上提供一些常用功能的入口,支持用户通过 CODE CHINA + Jupyter 的方式来使用这些内容:
- 练习( Fork+ Jupyter)
- 查看源项目 (CODE CHINA)
- 修改 (Fork + Jupyter + MR)
- 运行 (Jupyter)
- 讨论
- 分享
### 流程图
允许用户非常方便的绘制(通过 DrawIO 插件)流程图,并且进行分享(分享的是源文件),官方有个 导出 的 [issue](https://github.com/QuantStack/jupyterlab-drawio/issues/93),到时候可以参考一下
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册