Copying code snippets into IPython / Jupyter Notebooks
<p>Note, my question is specifically about Jupyter <strong>Notebooks.</strong> In addition, I don't just want to run the code, like you can get in the ipython console with <code>%paste</code>. I want to paste the code snippet into a cell and edit it before running. (So this is not a duplicate of either <a href="https://stackoverflow.com/questions/24242707/how-to-paste-examples-into-ipython">this question</a> or <a href="https://stackoverflow.com/questions/34861234/python-ignoring-leading-and-in-interactive-mode/34861305#34861305">this one</a>.)</p>

<p>A lot of example snippets in pandas and seaborn documentation have a form like:</p>

<pre><code>&gt;&gt;&gt; import pandas as pd
&gt;&gt;&gt; df = pd.DataFrame({'A': {0: 'a', 1: 'b', 2: 'c'},
...                    'B': {0: 1, 1: 3, 2: 5},
...                    'C': {0: 2, 1: 4, 2: 6}})
&gt;&gt;&gt; df
</code></pre>

<p>To get rid of the '>>>' and '...', I currently paste snippets into a Sublime Text editor, use the multiple cursor to properly format the code, and then paste it into the notebook cell.</p>

<p>Is there a more efficient way to do this and if so, what is it?</p>