Automatically cache results of intensive computations in IPython.
Project description
%%pdcache cell magic
Automatically cache results of intensive computations in IPython.
Inspired by ipycache.
Installation
$ pip install ipy-pdcache
Usage
In IPython:
In [1]: %load_ext ipy_pdcache
In [2]: import pandas as pd
In [3]: %%pdcache df data.csv
...: df = pd.DataFrame({'A': [1,2,3], 'B': [4,5,6]})
...:
In [4]: !cat data.csv
A,B
1,4
2,5
3,6
This will cache the dataframe and automatically load it when re-executing the cell.
%load_ext ipy_pdcache import pandas as pd
%%pdcache df data.csv print('hu') df = pd.DataFrame({'A': [1,2,3], 'B': [4,5,6]}) print('ha') 1
Dev:
- https://ipython.readthedocs.io/en/stable/config/extensions/
- https://ipython.readthedocs.io/en/stable/config/custommagics.html#defining-magics
Testing:
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ipy_pdcache-0.0.3.tar.gz
(3.1 kB
view hashes)
Built Distribution
Close
Hashes for ipy_pdcache-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87c5695f99bd57a6caebb4e7ee94d7871edf833125b2a8a8e555385b904f9b2a |
|
MD5 | 52bb55a60116bbda13672d8eb56aa542 |
|
BLAKE2b-256 | 6e1a2981d554170b25dbaa52d9cde0dbbc8d387fb85d3159acabf5cd27c499dc |