当前位置:网站首页>Jupyter shortcuts
Jupyter shortcuts
2022-08-01 05:13:00 【孤舟独钓寒江雪】
1、 Shortcuts
1.1 模式切换
ESC: 命令模式
Enter: 编辑模式
Y: code(ESC)
M: MD(ESC)
R: raw(ESC)
1.2 单元格选择
shift+mouse: Multiple choice
shift+↑/↓: Multiple choice
shift+HOME/END: Select current and all cells above/below
1.3 split/merge
shift+M: Merge current and below cells(ESC)
Ctrl+shift+‘-’: split cell
1.4 insert
A: insert cell above(ESC)
B: insert cell below(ESC)
1.5 delete
dd(双击d): delete the selected cell(ESC)
z: restore the last deleted cell(ESC)
Ctrl+d: delete cursor line(Enter)
Ctrl+backspace/delete: delete the previous/next word
1.6 code
Ctrl+/: Comment/uncomment code
shift+L/L: Display all/the current cell code line number(ESC)
Ctrl+]/[: indent/unindent (or Select code block,Tab/shift+Tab)
Ctrl+A/Z/Y: all/undo/redo
Tab: code completion
shift+Tab: 提示
shift: 忽略
1.7 光标快速移动
Ctrl+Home/End: Skip to beginning/end of cell
Ctrl+←/→: Skip to the left/right a prefix
1.8 运行代码
Ctrl+Enter: run the current cell
Alt+Enter: Run the current cell and insert a cell below
shift+Enter: Run the current cell and jump to the next cell
1.9 others
F: Find and replace(ESC)
H: shortcuts
X/C/Z/shift+V/V/S: 剪切/复制/撤销/上方粘贴/下方粘贴/保存(ESC)
Shift+space/space: scroll up/down
2、Jupyter 中的魔法函数(IPython特有的函数)
%lsmagic 列出所有魔法函数
%who? 在某个命令后面添加?可以查看具体使用方法
%pwd 显示Jupyter当前的工作空间
%hist 显示当前Jupyter中所有运行过的历史代码
%who 显示当前Jupyter环境中的所有变量或名称
%rest 删除当前Jupyter环境中的所有变量或名称
%timeit 计算当前行代码的运行时长(放该行开头) %timeit –n10:运行10轮
%%time 计算当前cell代码的运行时长(放在cell开头)
%matplotlib 用于显示绘图结果的风格
%load 加载本地Python文件或者网络中的Python文件
%run 运行本地或网络中的Python文件
%%writefile 将代码块保存为指定的文件名
# Jupyter 运行不同语言代码
在单元格开头输入:%%***
E.g:%%bash,%%HTML,%%python2,%%python3,%%ruby,%%perl
# 由于 %matplotlib inline 的存在,当输入plt.plot(x,y_1)后,不必再输入 plt.show(),图像将自动显示出来
边栏推荐
- 类神经网络训练不起来怎么办
- 4D line-by-line analysis and implementation of Transformer, and German translation into English (3)
- LeetCode 231. 2 的幂
- 剑指 Offer 68 - II. 二叉树的最近公共祖先
- UE4 模型OnClick事件不生效的两种原因
- HJS-DE1/2时间继电器
- 2022年超全的Android面经(附含面试题|进阶资料)
- Robot_Framework: Assertion
- Swastika line-by-line parsing and realization of the Transformer, and German translation practice (2)
- Lawyer Interpretation | Guns or Roses?Talking about Metaverse Interoperability from the Battle of Big Manufacturers
猜你喜欢
typescript25 - type assertion
pytorch、tensorflow对比学习—计算图和微分机制
AspNet.WebApi.Owin 自定义Token请求参数
About making a progress bar for software initialization for Qt
Robot_Framework:常用内置关键字
mysql中解决存储过程表名通过变量传递的方法
2022/07/29 入职健海JustFE团队,我学到了高效开发(年中总结)
(2022牛客多校四)A-Task Computing (排序+动态规划)
Lawyer Interpretation | Guns or Roses?Talking about Metaverse Interoperability from the Battle of Big Manufacturers
剑指 Offer 68 - I. 二叉搜索树的最近公共祖先
随机推荐
Robot_Framework:常用内置关键字
MySQL-Data Operation-Group Query-Join Query-Subquery-Pagination Query-Joint Query
LeetCode 1189. “气球” 的最大数量
AspNet.WebApi.Owin 自定义Token请求参数
Selenium:操作Cookie
请问shake数据库中为什么读取100个collection 后,直接就退出了,不继续读了呢?
2022年超全的Android面经(附含面试题|进阶资料)
挑战52天背完小猪佩奇(第01天)
剑指 Offer 68 - II. 二叉树的最近公共祖先
PAT class B 1001 (3n+1) conjecture
typescript26 - literal types
图片更新之后Glide加载依旧是原来的图片问题
Selenium: Introduction
typescript24 - type inference
用控件当画笔获得bitmap代码记录
力扣(LeetCode)212. 单词搜索 II(2022.07.31)
用位运算为你的程序加速
(Codeforce 757) E. Bash Plays with Functions
Malicious attacks on mobile applications surge by 500%
Challenge 52 days to memorize Peppa Pig (Day 01)