Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/takluyver/cell2function
IPython extension to convert a cell to a function
https://github.com/takluyver/cell2function
Last synced: 4 days ago
JSON representation
IPython extension to convert a cell to a function
- Host: GitHub
- URL: https://github.com/takluyver/cell2function
- Owner: takluyver
- Created: 2014-02-27T01:03:34.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-03-28T00:52:03.000Z (over 10 years ago)
- Last Synced: 2024-11-05T10:58:17.992Z (about 2 months ago)
- Language: Python
- Size: 148 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
IPython extension to convert a cell to a function
Code that starts off as exploratory interactive code in a notebook often
solidifies into something that you want to reuse in other cells. This utility
turns a cell into a function definition. The new function expects every variable
that was used before it's defined, and returns every variable defined in that cell.
This will rarely be right, but deleting code is easier than writing it.To use it, load the extension with ``%load_ext cell2function``, and then add
``%%cell2function`` at the top of cells you want to turn into functions. The new
functions will appear in a new cell beneath.See `the demo notebook `_
for more information.