如何将 Colab 笔记本导出为 pdf 文件
这是我第一次在这个论坛上问一个问题,因此,任何提示或建议都非常感谢!
至于问题本身,我已经看到了有关如何将Colab笔记本电脑导出为PDF的许多讨论,但是我想更具体地询问是否有任何方法可以保留执行代码的输出(例如:我希望用熊猫的数据框制成的桌子在笔记本上打印出来,而不是一堆字符串)。
this is my first time asking a question on this forum, so, any tip or suggestion is highly appreciated!
As for the question itself, I have already seen many discussions on how to export a Colab notebook as a pdf, however I would like to ask more specifically if there is any way of doing it that can preserve the output of executed code (e.g.: I would like tables made from dataframe in pandas to be exported as they were printed on the notebook and not like a bunch of strings).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为更简单的方法是您可以使用浏览器打印功能。
对于大多数浏览器,其快捷方式应该是 ctrl + p,
而更难的方法是您可以将 ipynb 文件下载到您的计算机上,然后使用 jupyter 笔记本来执行此
操作工作中,您应该安装
notebook-as-pdf
pip 包,然后您需要在命令行或终端中使用此命令,之后您就可以使用 jupyter Notebook 打开您的 ipynb你应该找到文件菜单的“下载为”部分中的“PDF via HTML(pdf)”选项,
换句话说,它应该在这里:
如果您想了解有关此用途的更多详细信息这个 和 这个。
I think the easier method is you can use browser print functionality.
for most browser it's shortcut should be
ctrl + p
and the the harder method is that you can download ipynb file to your machine and then use jupyter notebook to do this
for this to work you should install
notebook-as-pdf
pip package and then you need to use this command in your command-line or terminalafter that you are all set, so now you can open your ipynb with jupyter notebook and you should find "PDF via HTML(pdf)" option in "download as" section of file menu
in other word it should be here:
if you want more details on this use this and this.