Skip to content

Instantly share code, notes, and snippets.

@bweigel
Created July 3, 2017 22:47
Show Gist options
  • Save bweigel/7c15e266fca6ea6369f7c6425c35214a to your computer and use it in GitHub Desktop.
Save bweigel/7c15e266fca6ea6369f7c6425c35214a to your computer and use it in GitHub Desktop.
Clean Jupyter notebooks from output using jq
#!/bin/bash
cat $1 | jq '. + {"cells": [.cells[] | if .cell_type == "code" then . + {"outputs" : []} else . end]}'
@nobane
Copy link

nobane commented Feb 17, 2023

Cool, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment