ipython-notebook

what is the ipython notebook “Terminals” menu option

╄→гoц情女王★ 提交于 2019-11-29 01:56:32
问题 I am running ipython notebook on my OSX machine and/or my ubuntu 14.04 machine. I am using ipython 3.0.0, and ipython (jupyter) notebooks. When I start an ipython notebook, under New there is a terminal option, but it's unavailable for me. I haven't been able to find any documentation on this feature, how to activate it or what it does. The ipython notebook --help command doesn't mention it and I haven't found anything in the documentation either. I haven't discovered the special keywords to

iPython: Manipulate-like command

梦想与她 提交于 2019-11-29 00:56:26
问题 In Wolfram Mathematica, I can interactively modify the value of a parameter by using the Manipulate[] command. For example, Manipulate[n, {n, 1, 20}] shows a slider through which is possible to vary the value of n . Is there any simple way (i.e. something like a magic or a decorator, like in SAGE) to achieve the same result in the IPython notebook? 回答1: Update This was added in IPython 2.0 (released Apr 1, 2014), it's called Interactive Widgets and works in web notebooks. Original answer This

Open an ipython notebook via double-click on osx

此生再无相见时 提交于 2019-11-29 00:48:54
问题 I've downloaded a couple of ipython notebooks, and I'd like to open them in browser tabs without navigating to the directory I've downloaded them to and running ipython notebook notebook_name.ipynb . I realize this probably means I'm lazy, but it seems like a common use case to me. Am I missing something obvious? 回答1: Use Pineapple application for opening and working on your IPython/Jupyter notebooks. It is pretty cool. Update: Now there is nteract, which is a new jupyter-like Desktop app.

Per-cell output for threaded IPython Notebooks

不打扰是莪最后的温柔 提交于 2019-11-28 23:55:01
I don't want to raise this as an issue, because it seems like a completely unreasonable feature request for what is a fairly amazing tool. But if any readers happen to be familiar with the architecture I'd be interested to know if a potential extension seems feasible. I recently wrote a notebook with some simple threaded code in it, just to see what would happen when I ran it. The notebook code (tl;dr it starts a number of parallel threads that print in a sleep loop) is available at https://gist.github.com/4562840 . By hitting SHIFT-RETURN a few times as the code runs you can observe that any

How to clear an IPython Notebook's output in all cells from the Linux terminal?

一笑奈何 提交于 2019-11-28 23:47:49
问题 I have a problem when the output from a notebook is really long and it's saved into the notebook, any time I want to open this particular notebook again the browser crashes and can't display correctly. To fix this I have to open it with a text editor and delete all output from that cell causing the problem. I wonder if there is a way to clean all output from the notebook so one can open it again without problem. I want to delete all output since deleting a specific one seems more troublesome.

External editor for IPython notebook

柔情痞子 提交于 2019-11-28 23:35:49
问题 I am using IPython notebook and I want to edit programs in an external editor. How do I get the %edit file_name.py to open an editor such as Notepad++. 回答1: Running %edit? will give you the help for the %edit magic function. You need to set c.TerminalInteractiveShell.editor , which is in your ipython_config.py. I'm not quite sure where this is located in Windows; on OS X and Linux, it is in ~/.ipython. You'll want to set the variable to be the full path of the editor you want. Alternatively,

Can you capture the output of ipython's magic methods? (timeit)

你。 提交于 2019-11-28 22:53:11
I want to capture and plot the results from 5 or so timeit calls with logarithmically increasing sizes of N to show how methodX() scales with input. So far I have tried: output = %timeit -r 10 results = methodX(N) It does not work... Can't find info in the docs either. I feel like you should be able to at least intercept the string that is printed. After that I can parse it to extract my info. Has anyone done this or tried? PS: this is in an ipython notebook if that makes a diff. Iguananaut This duplicate question Capture the result of an IPython magic function has an answer demonstrating that

How to export figures to files from IPython Notebook

北城余情 提交于 2019-11-28 22:07:59
问题 I use the IPython Notebook with the --pylab inline option, since I don't want plots to show up in a different window. Now I'd like to save the plots I see in the notebook to PDF or PNG files. Some code examples use import matplotlib as plt plt.savefig("figure.png") # save as png but this does not seem to work in inline mode. Of course I could simply save the PNG that is generated out of the browser, but I'd like to do this with a line of Python. I am also interested in PDF export. 回答1: try

How do I run Python asyncio code in a Jupyter notebook?

主宰稳场 提交于 2019-11-28 21:16:01
I have some asyncio code which runs fine in the Python interpreter (CPython 3.6.2). I would now like to run this inside a Jupyter notebook with an IPython kernel. I can run it with import asyncio asyncio.get_event_loop().run_forever() and while that seems to work it also seems to block the notebook and doesn't seem to play nice with the notebook. My understanding is that Jupyter uses Tornado under the hood so I tried to install a Tornado event loop as recommended in the Tornado docs : from tornado.platform.asyncio import AsyncIOMainLoop AsyncIOMainLoop().install() However that gives the

a new thread for running a cell in ipython/jupyter notebook

杀马特。学长 韩版系。学妹 提交于 2019-11-28 20:21:37
Sometimes it takes a long time to run a single cell, while it is running, I would like to write and run other cells in the same notebook, accessing the variables in the same context. Is there any ipython magic that can be used such that when it is added to a cell, running the cell will automatically create a new thread and run with shared global data in the notebook? It may not be an answer, but rather the direction to it. I did not saw anything like that, still I'm interested in this too. My current findings suggesting that one need to define it's own custom cell magic . Good references would