Menu
  • HOME
  • TAGS

One-liner or short script to run the code inside a Jupyter notebook?

julia-lang,jupyter,ijulia-notebook

Here's what I have written up: using JSON get_code_cells(j::Dict) = filter(x->x["cell_type"] == "code", j["cells"]) function parse_code_cell(c::Dict) buf = IOBuffer() write(buf, "begin\n") map(x->write(buf, x), c["source"]) write(buf, "\nend") src = bytestring(buf) parse(src) end extract_code(cells::Vector) = Expr[parse_code_cell(c) for c in cells] extract_code(j::Dict) = extract_code(get_code_cells(j)) eval_code(j::Dict) = map(eval, extract_code(j)) # get filename, then parse...

Change default iPython in homebrew to use Python 2.x.x instead of Python 3.x.x

python,python-3.x,ipython,homebrew,jupyter

Ok, I found the answer. Simply copy the ipython2 file to ipython: cp /usr/local/bin/ipython2 /usr/local/bin/ipython ...

How to manage and communicate with multiple IPython/Jupyter kernels from a Python script?

python,ipython,ipython-notebook,jupyter

A KernelManager deals with starting and stopping a single kernel, and there's a MultiKernelManager to co-ordinate more than one. http://ipython.org/ipython-doc/3/api/generated/IPython.kernel.manager.html http://ipython.org/ipython-doc/3/api/generated/IPython.kernel.multikernelmanager.html Then you can use the .client() method to get a KernelClient instance which handles communications with a kernel: http://ipython.org/ipython-doc/3/api/generated/IPython.kernel.client.html For details of how you communicate with a kernel, see...

django-extensions shell_plus --kernel specify connection file

python,django,ipython,jupyter,django-extensions

For anyone interested, I fixed this by adding a --connection_file option to the shell_plus command in django-extension, which then forwards the filename to the kernel. I can then define my django kernel for Jupyter-hub as the following. { "display_name": "Django", "language": "python", "codemirror_mode": { "version": 3, "name": "ipython" }, "argv":...

jupyter kernels in OSX: No module named IPython

python,osx,ipython,anaconda,jupyter

Updating to IPython 3.2.0 will fix this issue. For details see pull request PR-8527.

Jupyter: how to make simple illustrations

ipython-notebook,tikz,jupyter

TikZ (prefered solution) If you're already familiar with TikZ the respective magic is probably the best option. To use it, simply clone this repo into your .ipython/extensions directory and load the extension as shown in the example notebook with %load_ext tikzmagic. I just tried with IPython 3.1 and it works...

Open 'ipython notebook' as: IPython notebook vs Jupyter

ipython,ipython-notebook,jupyter

ipython is now called Jupyter so perhaps a different version of Anaconda is installed on the other computer? So Jupyter is what ipython will continue to develop as - they dropped python as it is basically "agnostic": it can load different languages - python 2 or 3, but also R...

How do I set the amount of text to be displayed in IJulia

julia-lang,jupyter,ijulia-notebook

You can adjust the amount of characters to display before truncation by setting the global env options as shown below: ENV["LINES"] = 150 ENV["COLUMNS"] = 300 You may still have issues with its wrapping though....

Troubles after updating ipython (%matplotlib nbagg)

python,matplotlib,ipython,ipython-notebook,jupyter

I guess this issue is caused by a too old version of matplotlib. Using %matplotlib nbagg with ipython>=3.0 requires matplotlib>=1.4.3 (Note that %matplotlib notebook and %matplotlib nbagg are now synonyms). Updating matplotlib via pip install --upgrade matplotlib will probably fix this issue. See also my issue-7797 on github. Thanks to...

Changing the default port for iPython notebook server / Jupyter

port,ipython,ipython-notebook,anaconda,jupyter

Something is already listening on 80, you cannot bind 2 servers to the same port. Use a proxy that listen to 80, and redirect to your other servers and IPython base on URL, or address. Also don't use 80, use 443, if you are running a public server it should...

How do I add a kernel on a remote machine in IPython (Jupyter) Notebook?

python,ipython,ipython-notebook,ipython-parallel,jupyter

IPython use kernel is a file in ~/.ipython/kernel/<name> that describe how to launch a kernel. If you create your own kernel (remote, or whatever) it's up to you to have the program run the remote kernel and bind locally to the port the notebook is expected.

R not producing a figure in jupyter (IPython notebook)

r,windows-8,ipython-notebook,anaconda,jupyter

I found a solution from the post on this group. Solution I did: I had the most release of R (R 3.2.0) and following the discussion in the above link, I installed R 3.1.3 and copied winCairo.dll from C:\Program Files\R\R-3.1.3\library\grDevices\libs\x64 to C:\Anaconda\R\library\grDevices\libs\x64. Copying winCairo.dll from R 3.2.0 does not work...

Julia parallel computing in IPython Jupyter

parallel-processing,ipython-notebook,julia-lang,jupyter

Using addprocs(4) as the first command in your notebook should provide four workers for doing parallel operations from within your notebook.

How can I see function arguments in IPython Notebook Server 3?

ipython-notebook,jupyter

In 1.0, the functionality was bound to ( and tab and shift-tab, in 2.0 tab was deprecated but still functional in some unambiguous cases completing or inspecting were competing in many cases. Recommendation was to always use shift-Tab. ( was also added as deprecated as confusing in Haskell-like syntax to...

Unable to run ipython-notebook 2.7 with jupyterhub

ipython,ipython-notebook,jupyter

~/.ipython/kernels.json is not the right path. And theses files are not ment to be edited by hand. Also the file you have is not valid json, the server will be unable to read it if it was in the right place. use python2.7 -m IPython kernelspec install-self and python3 -m...

Is it possible to speed up interactive IPython Notebook plots by not generating new figures every time?

python,matplotlib,ipython-notebook,interactive,jupyter

Some setup: %matplotlib notebook import matplotlib.pyplot as plt from IPython.html.widgets import interactive from IPython.display import display import numpy as np Create your objects: fig, ax = plt.subplots() ax.set_xlim(0, .25) ax.set_ylim(-2.5, 2.5) ax.set_title('beat frequencies') lnA, = ax.plot([], [], color='r', label='A') lnB, = ax.plot([], [], color='purple', label='B') lnsum, = ax.plot([], [], color='k',...