收藏 | 10个可以快速用Python进行数据分析的小技巧(12)

绿色警示框:成功

<div class=\"alert alert-block alert-success\">Use green box only when necessary like to display links to related content.</div>

红色警示框:高危

<div class=\"alert alert-block alert-danger\">It is good to avoid red boxes but can be used to alert users to not delete some important part of code etc.</div>

打印单元格所有代码的输出结果

假如有一个Jupyter Notebook的单元格 , 其中包含以下代码行:

In[1
: 10+511+6Out[1
: 17

单元格的正常属性是只打印最后一个输出 , 而对于其他输出 , 我们需要添加print函数 。 然而通过在notebook顶部添加以下代码段可以一次打印所有输出 。

添加代码后所有的输出结果就会一个接一个地打印出来 。

推荐阅读