在单元格 jupyter 笔记本中关闭警告

新手上路,请多包涵

我在 python 3 jupyter notebook 中收到一些无用的警告。我只想在特定单元格中关闭这些警告,而不是在 ipynb 文件的其余部分中。有人知道怎么做吗?

原文由 Marnix 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 555
1 个回答

%%capture 写为单元格的第一行以捕获单元格输出。 You can use the options --no-stderr , --no-stdout , --no-display , and --output to control which cell outputs will be caught. 在此处查看更多详细信息。

原文由 Joshua Dempster 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进