ipython-notebook

How do I reset the Jupyter/IPython input prompt numbering?

六月ゝ 毕业季﹏ 提交于 2019-12-03 08:03:57
问题 I just wrote my first extensive Python tutorial using IPython notebooks. All went well, except I did a lot of testing and moving blocks around. How do I reset the In [ ]: numbering? I have tried quitting and reloading, but that doesn't seem to work. 回答1: I think, the only way to to what you want is: - 'Kernel > Restart' (restart the kernel) and then 'Cell > Run All' (run the script). 回答2: You can reset the kernel (shortcut: C-m . ) and re-run the whole notebook. Quitting and reloading doesn't

iPython notebook Websocket connection cannot be established

元气小坏坏 提交于 2019-12-03 07:49:00
iPython was working fine until a few hours ago when I had to do a hard shutdown because I was not able to interrupt my kernel. Now opening any notebook gives me the following error: "WebSocket connection to could not be established. You will NOT be able to run code. Check your network connection or notebook server configuration." I have the latest version of Chrome and I am only trying to access local notebooks. The Javascript console gives me this: Starting WebSockets: [link not allowed by StackOverflow]/737c7279-7fab-467c-9e0f-cba16233e4b5 kernel.js:143 WebSocket connection failed: [link not

how to execute scrapy shell “URL” with notebook

社会主义新天地 提交于 2019-12-03 07:26:11
i am trying to scrapy and there is scrapy shell "URL" command, executing console ipython with a response object from the URL. but i want to do that thing with notebook. is there any way to execute scrapy shell with notebook, or how can i get the same response object of the URL in ipython manually? Stumbled across this unanswered question looking for the same answer. The closest thing I can come up right now is this: import requests from scrapy.http import TextResponse r = requests.get('http://stackoverflow.com/') response = TextResponse(r.url, body=r.text, encoding='utf-8') Then you can debug

How to remove heading numbers in Jupyter during pdf conversion?

为君一笑 提交于 2019-12-03 06:53:55
问题 When I use the heading tags (# ##, etc) using markdown, they are always converted to numbered sections during pdf-latex conversion. How to indicate unnumbered headings in markdown in Jupyter Notebook (IPython)? I realize this can be done by adding a '*' right next to each section directly in the latex document, but is there any other way to do this? 回答1: You can write an unnumbered heading by appending {-} or {.unnumbered} to the Markdown cell, e.g.: Heading {-} The output is a heading

Display SVG in IPython notebook from a function

妖精的绣舞 提交于 2019-12-03 06:51:24
问题 In IPython notebook, the following code displays the SVG below the cell: from IPython.display import SVG SVG(url='http://upload.wikimedia.org/wikipedia/en/a/a4/Flag_of_the_United_States.svg') The following displays nothing: from IPython.display import SVG def show_svg(): SVG(url='http://upload.wikimedia.org/wikipedia/en/a/a4/Flag_of_the_United_States.svg') Is there a way to display an SVG from within a function (or a class)? 回答1: You need to display the SVG like from IPython.display import

ipython notebook terminals unavailable [duplicate]

有些话、适合烂在心里 提交于 2019-12-03 06:50:01
This question already has an answer here: what is the ipython notebook “Terminals” menu option 4 answers I installed anaconda and I get this (python 2.7.9) I am running ipython notebook on Windows 8 and terminal option unavailable for me. How do I activate it? please Windows do not support tty terminal, and terminado only works if the underlying terminal is a tty. So for now there is not support for terminals on Windows. There is no short-term plan to support terminal either. 来源: https://stackoverflow.com/questions/31092823/ipython-notebook-terminals-unavailable

Changing the default port for iPython notebook server / Jupyter

孤人 提交于 2019-12-03 06:44:32
问题 I am trying to run an ipython notebook / jupyter server on a machine behind a firewall. The only port which is open is port 80. So was wondering how I can change the default port from 8890 to 80? I have ran the following command ipython profile create to create a profile. Then edited ipython_notebook_config.py and edited it to contain the following: c = get_config() c.NotebookApp.port = 80 When I try to run python notebook. I get the following error: ERROR: the notebook server could not be

function name + tab does not return docstring in IPython

穿精又带淫゛_ 提交于 2019-12-03 06:44:25
问题 In IPython, I am used to write function( and then strike a tab, and get the contents of the docstring and a list of the named arguments. However, this stopped working since I installed IPython 2.0. Is there an explanation or a know fix? 回答1: Oh, the shortcut is now shift+tab . 回答2: Shift-tab only works when you place the edit cursor inside or after the object. Not when it's at the start of the object. This gotcha is not documented anywhere...! I filed jupyter issue Shift-Tab completion doesn

Converting ipython notebook to html with separate images

烈酒焚心 提交于 2019-12-03 06:30:53
I have an ipython notebook with a mixture of SVG and PNG graphs. I can export it to html without any trouble, but it embeds the images as encoded text in the body of the .html file. I'm calling: ipython nbconvert --to html mynotebook.ipynb The output at the command line includes: [NbConvertApp] Converting notebook mynotebook.ipynb to html [NbConvertApp] Support files will be in mynotebook_files/ but no such directory is created, and there are no files in it. There are related posts ( 1 , 2 , 3 , 4 ) but they either don't fix this specific issue, or refer to the olden days when NBconvert was a

What tools are available to export an ipython notebook to a PDF file? [closed]

假如想象 提交于 2019-12-03 06:01:47
I have a nicely-formatted ipython notebook complete with markdown cells and whatnot. I'm wondering what my options are in terms of exporting to a PDF file. So far, I've been going to File > Print View and printing the resulting page to PDF with chromium's "save to file" function. This technically works , but it has one major inconvenience: my figures, code and markdown cells are often split by page breaks. Are there any other solutions for explort such that I can have one continuous PDF file? EDIT: I ran into nbconvert , but when I keep getting a "file not found" error. Anybody have any luck