从Jupyter笔记本中删除空白行 [英] Deleting blank lines from Jupyter notebook

查看:3550
本文介绍了从Jupyter笔记本中删除空白行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种简便的方法可以从IPython笔记本中删除空白行?

Is there an easy way of removing blank lines from IPython notebook?

我从Web开发中养成了空白行的习惯,而我的手指往往会自动按Enter键.这使IPython笔记本更少(通过占用我的14英寸屏幕过多),在大多数情况下不易读.

I have picked up a habit of blank lines from web development and my fingers tend to hit enter automatically. This makes IPython notebooks less(by taking too much of my 14" screen), not more readable in most cases.

我想知道是否有一种方法可以自动删除笔记本中的空白行.

I was wondering if there is a way of automatically remove blank lines from the notebooks.

在笔记本中,我认为分割代码的首选方法是将每个单独的方法放在不同的单元格中.

In notebooks, I think preferred way of splitting the code is by placing each separate method to a different cell.

是笔记本电脑常用的样式指南,还是PEP 8照原样应用?

Is commonly accepted style guide for notebooks or does PEP 8 apply as it is?

编辑:我认为问题2由IPython文档回答. https://github.com/ipython/ipython/wiki/Dev:-Coding样式

I think question 2, Is answered by IPython docs. https://github.com/ipython/ipython/wiki/Dev:-Coding-style

推荐答案

如果您要谈论的是从网络浏览器中打开的jupyter笔记本中删除空行,请按Esc和D(键盘键)两次.

If you are talking about deleting the empty line from jupyter notebook which opens in web browser then press Esc and D(keyboard key) 2 times.

您还可以在jupyter笔记本文件

You can also see all the keyboard shortcuts in the jupyter notebook file

通过单击帮助,然后从键盘快捷键的下拉菜单中.

by clicking on the help and then from dropdown on keyboard shortcuts.

这篇关于从Jupyter笔记本中删除空白行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆