ipython-notebook

IPython/Jupyter Installing Extensions

耗尽温柔 提交于 2019-12-01 11:05:05
I'm having troubles installing extensions in IPython. The problem is that i can't get the extensions load automatically, i have followed the instructions in the github page but it just doesn't work. According the the homepage i need to modify the custom.js file by adding some lines. I want to install the codefolding, hide_input_all and runtools extensions. This is how my custom.js file looks: // activate extensions only after Notebook is initialized require(["base/js/events"], function (events) { $([IPython.events]).on("app_initialized.NotebookApp", function () { /* load your extension here */

IPython/Jupyter Installing Extensions

不羁的心 提交于 2019-12-01 08:48:34
问题 I'm having troubles installing extensions in IPython. The problem is that i can't get the extensions load automatically, i have followed the instructions in the github page but it just doesn't work. According the the homepage i need to modify the custom.js file by adding some lines. I want to install the codefolding, hide_input_all and runtools extensions. This is how my custom.js file looks: // activate extensions only after Notebook is initialized require(["base/js/events"], function

Animations in ipython (jupyter) notebook - ValueError: I/O operation on closed file

大憨熊 提交于 2019-12-01 08:01:54
问题 I have a jupyter notebook that produces an animation. It was working on my old laptop (xubuntu gnu/linux). Now on my new laptop (trisquel gnu/linux) it's not working. This makes me think I have a missing library or something like that but I can't work it out. As a test, I went back to the tutorial where I learned how to do jupyter notebook animations in the first place (http://louistiao.me/posts/notebooks/embedding-matplotlib-animations-in-jupyter-notebooks/). I get the same problem when I

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

巧了我就是萌 提交于 2019-12-01 06:55:47
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 test stuff out with the argparse module. 来源: https://stackoverflow.com/questions/38755864/in-ipython-how

Display multiple output tables in IPython notebook using Pandas

社会主义新天地 提交于 2019-12-01 04:23:23
I now know that I can output multiple charts from IPython pandas by embedding them in one plot space which will appear in a single output cell in the notebook. Can I do something similar with Pandas HTML Tables? I am getting data from multiple tabs (about 15-20) on a spreadsheet and running them though a set of regressions and I'd like to display the results together, perhaps 2 up.. But since the function to display the table only displays one, the last one, not sure how to approach. Ideas? I'd even be happy to display in successive output cells.. not real sure how to do that either But I

Writing an IPython notebook to HTML or PDF with Table Of Content

不想你离开。 提交于 2019-12-01 04:03:01
Im trying to create a report from my IPython notebook. Im using the toc extension to create a toc for my nb. I already converted the notebook to html, but the toc is not shown and is not linking to the rest of the doc. Is there any way to convert to one of the specified fromat and still keep a link-able (or even non-link-able) TOC? Assuming you use IPython 1.x you have the following options to include the toc in the pdf use the latex_book template ( ipython nbconvert --to=latex --template=latex_book --post=pdf file.ipynb ) extend the latex_article (default) template Create a file with the

Ipython is working in command prompt but not in browser

蹲街弑〆低调 提交于 2019-12-01 03:54:45
I am using a windows 8 64 bit laptop. I already have python 2.7 on my pc. So I installed Ipython using the easy_install. I can now see an ipython application file in C:\Python27\Scripts. When I run that file it opens up my cmd and I can write code. However when I say Ipython notebook in the cmd under the same folder it does not open up the notebook in a browser and gives the following error - C:\Users\UserName>cd C:\Python27\Scripts\ C:\Python27\Scripts>Ipython notebook Traceback (most recent call last): File "C:\Python27\Scripts\ipython-script.py", line 9, in <module> load_entry_point(

Ipython Notebook: how to run multiple cells?

こ雲淡風輕ζ 提交于 2019-12-01 03:27:05
My notebook gets a bit of long, I divide it into several parts. Sometimes, I just want to run a certain part of it, i.e consecutive cells For example, I want to run Cell IN [52] to[54] , not run IN [51],[59] . How can I do it? I only know there is option for run above , run below , I didn't see anything like run selected cells . UPDATE: Now Jupyter Notebook has this feature built-it, simply CTRL + click UPDATE as per Jan 2018: You can select and run multiple cells in command mode using the below shortcuts: 1.shift+K (select the cells in an upward direction) and then Ctrl+Enter 2.shift+J

IPython Notebook Tab-Complete — Show Docstring

无人久伴 提交于 2019-12-01 03:05:44
I just upgraded to IPython 2.0.0 and the behavior of tab-complete seems to have changed for the worse. (Using pyreadline 2.0, which according to this question might matter). Formerly, if I hit TAB after function_name( , IPython would show the docstring for that function. Now, I just see a dropdown list of what I guess is everything in the namespace, including: Error types names of other notebooks in the directory IPython magic functions Other functions I've defined etc. The old behavior was super helpful -- how can I restore it (short of reverting to an earlier IPython version)? Apparently it

IPython Notebook keyboard shortcut search for text

允我心安 提交于 2019-12-01 03:04:16
Is there a keyboard shortcut to search for text in an IPython Notebook? I looked under Help | Keyboard shortcuts and there are lots of cool shortcuts but none for searching for text? The notebook is running in FireFox on Ubuntu. There is a find-and-replace command in Jupyter. It's key binding is F (command mode): Of course you can find text with the browser's functionality, (I find it sometimes better), but the command in Jupyter is also very useful. I use a lot that function Replace in selected cells when I copy-paste a bunch of code and then change variables or something like that: ( Note: