我在 python 3 jupyter notebook 中收到一些无用的警告。我只想在特定单元格中关闭这些警告,而不是在 ipynb 文件的其余部分中。有人知道怎么做吗?
原文由 Marnix 发布,翻译遵循 CC BY-SA 4.0 许可协议
我在 python 3 jupyter notebook 中收到一些无用的警告。我只想在特定单元格中关闭这些警告,而不是在 ipynb 文件的其余部分中。有人知道怎么做吗?
原文由 Marnix 发布,翻译遵循 CC BY-SA 4.0 许可协议
将
%%capture
写为单元格的第一行以捕获单元格输出。 You can use the options--no-stderr
,--no-stdout
,--no-display
, and--output
to control which cell outputs will be caught. 在此处查看更多详细信息。