ipython-notebook

Customizing IPython notebook / Jupyter slide show

故事扮演 提交于 2019-12-04 04:06:35
I created a slideshow using the slideshow feature of IPython notebook / Jupyter, which works fine. I created and hosted the slides via ipython nbconvert ... which works fine too. But I cannot find any information how to customize the slides. Obviously I have to customize Reveal.js which is not very well documented too. Can somebody give a starting point on how to get some copyright, logo, ... in the header/footer of my presentation? Reveal.js is really just a web template. If you want to customize it further, CSS/Javascript knowledge will be required. A straightforward way to define header

IPython Notebook Javascript: retrieve content from JavaScript variables

房东的猫 提交于 2019-12-04 03:32:56
Is there a way for a function (called by an IPython Notebook cell) to retrieve the content of a JavaScript variable (for example IPython.notebook.notebook_path which contains the path of the current notebook)? The following works well when written directly within a cell (for example, based on this question and its comments): from IPython.display import display,Javascript Javascript('IPython.notebook.kernel.execute("mypath = " + "\'"+IPython.notebook.notebook_path+"\'");') But that falls apart if I try to put it in a function: # this doesn't work from IPython.display import display,Javascript

ipython notebook - $DISPLAY variable error [duplicate]

本秂侑毒 提交于 2019-12-04 02:40:52
This question already has an answer here : Closed 3 years ago . ipython notebook on linux VM running matplotlib interactive with nbagg (1 answer) I am running IPython notebook on an ubuntu vm. Everything works great so far, except I'm unable to do interactive matplotlib plots. The error I get is: TclError: no display name and no $DISPLAY environment variable And I'm just trying to follow these super basic tutorials. http://nbviewer.ipython.org/github/jakevdp/matplotlib_pydata2013/tree/master/notebooks/ Any tips? I've done some research but nothing seems applicable to running iPython from an

Can I autosave a running jupyter python notebook without having it open in a browser tab?

回眸只為那壹抹淺笑 提交于 2019-12-04 01:58:10
So I have a long-running python notebook. As long as it's open in my browser's tab, it's autosaving every 2 minutes, and life is good. Is it possible to keep it auto-saving even if I close the browser tab? The kernel already keeps running when I close the tab, which is great. This is kind of like "screen", but in jupyter EDIT: Even if I leave the tab open in my browser, I noticed that after 24 hours, the "kernel status" in the top right becomes "disconnected", even though the running cell still has output being piped to it from the server websocket connection Matt No, you can't (for now), and

In Ipython, how can I pass arguments to a cell as though it were its own script?

◇◆丶佛笑我妖孽 提交于 2019-12-04 01:36:22
问题 For instance, say I have some snippet of self-contained code in a cell, In [1] from sys import argv print(argv[1]) I want to be able to pass a value to the code in that cell, presumably through magic, so that In [2] %expelliarmus "In [1]" 69105 outputs 69105 Is there any simple way for me to do this, ideally without having to write the cell to my disk as a script? Edit: I can't just wrap it in a function because in the notebook I'm working in (not the example I posted above) I'm trying to

IPython notebook: How to connect to existing kernel?

限于喜欢 提交于 2019-12-04 01:04:33
I am able to connect two ipython console session to one kernel by: $ ipython console In [1]: %connect_info { ... Content of JSON with info for connecting ... } Paste the above JSON into a file, and connect with: $> ipython <app> --existing <file> or, if you are local, you can connect with just: $> ipython <app> --existing kernel-43204.json or even just: $> ipython <app> --existing if this is the most recent IPython session you have started. And accordingly I can substitute the <app> by console again $ ipython console --existing kernel-43204.json However, I want to share my kernel with ipython

Interactive plots in Jupyter (IPython) notebook with draggable points that call Python code when dragged

吃可爱长大的小学妹 提交于 2019-12-04 00:36:46
I'd like to make some interactive plots in the Jupyter notebook, in which certain points in the plot can be dragged by the user. The locations of those points should then be used as input to a Python function (in the notebook) that updates the plot. Something like this has been accomplished here: http://nbviewer.ipython.org/github/maojrs/ipynotebooks/blob/master/interactive_test.ipynb but the callbacks are to Javascript functions. In some cases, the code that updates the plot needs to be extremely complex and would take a very long time to rewrite in Javascript. I'm willing to designate the

ERROR: Line magic function `%matplotlib` not found

本小妞迷上赌 提交于 2019-12-04 00:02:24
I am the rawest of raw newbies. I have just installed IPython on a Mac (MacOS 10.7.5) following the instructions for anaconda on http://ipython.org/install.html , with no obvious errors. I now want to work my way through the example notebooks. In notebook "Part 1 - Running Code", everything works as it should until I get to %matplotlib inline Then I get the error message ERROR: Line magic function %matplotlib not found. Everything after that works, except that plots, instead of appearing inline, pop up in a new window. Matt Try: import IPython print(IPython.sys_info()) Does it report that you

iPython Notebook/Jupyter autosave failed

一世执手 提交于 2019-12-03 22:05:13
I am working in iPython 3/Jupyter running multiple kernels and servers. As such, i often forget to personally save things as I jump around a lot. The autosave has failed for the past 3 hours. The error says: "Last Checkpoint: 3 hours ago Autosave Failed! I try to manually File>>Save and Checkpoint, and nothing changes. Help! Next to my Python 2 kernel name, there is a yellow box that say forbidden instead of edit. It goes away when i click on it. I don't know if that has anything to do with the failure to save, but it doesn't change once clicked. I had same problem and I found out I was logged

Save ipython notebook as script programmatically

て烟熏妆下的殇ゞ 提交于 2019-12-03 21:23:49
问题 The excellent ipython notebook has a handy --script command line flag that automatically saves a copy of the notebook as a .py script file (removing any header and markdown cells). Is there a way to switch this feature on from inside the notebook itself after the notebook is opened? Apparently, this option is not accessible to the %config magic. Is there a way to have a cell that does this conversion? Is there any command-line tool I could use to do the conversion, and just have that in a