INNER CODE UNIT · Python

convert

rasbt/machine-learning-book · .convert_notebook_to_script.py:12

def convert(input_path, output_path):
    subprocess.call(['jupyter', 'nbconvert', '--to', 'script',
                     input_path, '--output', output_path])


def cleanup(path):

    skip_lines_startwith = ('Image(filename=',
                            '# In[',
                            '# <hr>',
                            'from IPython.display import Image',
                            'get_ipython()',
                            '# <br>')

    clean_content = []
    imports = []
    existing_imports = set()
    with open(path, 'r', encoding="utf8") as f:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…