oce*_*n11 17 python git jupyter-notebook
输出和元数据不用于代码审查,如果提交的话会很烦人。使用 git commit 时如何清除 Jupyter Notebook 的输出和元数据?
oce*_*n11 16
答案基于前2篇文章。
我的方法包括同时清理元数据。
将其添加到本地 .git/config
[filter "strip-notebook-output"]
clean = "jupyter nbconvert --ClearOutputPreprocessor.enabled=True --ClearMetadataPreprocessor.enabled=True --to=notebook --stdin --stdout --log-level=ERROR"
Run Code Online (Sandbox Code Playgroud)
在笔记本目录中创建一个 .gitattributes 文件,内容如下:
*.ipynb filter=strip-notebook-output
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
7808 次 |
最近记录: |