conda create -n py27 python=2.7 ipykernel
source activate py27
python -m ipykernel install --user --name py27 --display-name "Python 2.7"
conda create -n py27 python=2.7 ipykernel
source activate py27
python -m ipykernel install --user --name py27 --display-name "Python 2.7"
| Imagine you have a folder containing many files, and you want to apply a function to those files. | |
| ls *.ipynb | sed 's/.ipynb//' | xargs -i echo {}.ipynb-{}.log | |
| If you're in a folder containing `foo.ipynb`, `bar.ipynb`, 'baz.py`, you'll get: | |
| foo.ipynb-foo.log | |
| bar.ipynb-bar.log |
| ssh -N -f -L localhost:8800:localhost:8800 user@server |
| from IPython.display import HTML | |
| def _repr_html_(self, figsize=(17,10), **kwargs): | |
| """Displays in the notebook a folium.folium.Map object. | |
| """ | |
| self._build_map(**kwargs) | |
| width, height = figsize | |
| iframe = '<iframe src="data:text/html;base64,{html}" width="{width}" height="{height}"></iframe>'\ |
| import pymongo | |
| connection = pymongo.MongoClient() | |
| # get running operations | |
| list(connection.admin["$cmd.sys.inprog"].find()) | |
| # kill an operation by id | |
| op_id = 123456 |