ipython-notebook

Centering output on IPython notebook

倖福魔咒の 提交于 2019-12-05 16:07:00
I have a similar question to here . I have an IPython notebook, I'd like the output to have centered plots. I've copied the css file and everything as instructed in the above link, and, whilst the plots change style, they don't center on my screen. This might come a bit late but maybe Google brings more people here looking for a solution. We can style the output in the custom.css in the IPython profile and add the following: with (older) IPython .ui-wrapper { margin-left: auto !important; margin-right: auto !important; } After that you just have to reload the page in your browser. The ui

Customize welcome page of ipython notebook

半腔热情 提交于 2019-12-05 15:57:38
Can I customize the landing page of an iPython notebook server (version 2.3)? I mean that, at the starting page (something like: http://localhost:8888/tree ), I'd like to display Welcome to the i[Py] Notebook of John Doe or modify the existing banner.. Is this possible? You can change the banner logo or replace it with a text using your custom.css. Custom Title To simply change the text add the following lines #ipython_notebook::before{content:"Welcome to my notebook"} #ipython_notebook img{display:none;} Of course some additional styling may be necessary. Custom Banner Logo To change the

500 server error using IPython notebook on Windows

ぐ巨炮叔叔 提交于 2019-12-05 13:19:37
I've just done a fresh install of IPython notebook on Windows 7 Professional 64 bit. The steps I took were: Install Python 3.4.1 from http://python.org > pip install ipython[notebook] > pip install pywin numpy pygments nodeenv I can open a notebook fine. However, when I select File > Print Preview or File > Download as HTML I get a 500 server error. The stack trace is: 2014-08-07 09:44:25.431 [NotebookApp] Loaded template full.tpl C:\Python34\lib\site-packages\IPython\nbconvert\filters\markdown.py:78: UserWarning: Node.js 0.9.12 or later wasn't found. Nbconvert will try to use Pandoc instead.

IPython notebook to slides: Reveal is not defined

蹲街弑〆低调 提交于 2019-12-05 13:16:57
I'm using nbconvert to make a reveal.js slideshow from my notebook. Specifically, I'm running: ipython nbconvert --to slides analysis.ipynb . This creates "analysis.slides.html", and I put "reveal.js" in the same folder. That is, I have: reveal.js ... analysis.ipynb analysis.slides.html However, when opening "analysis.slides.html" in the browser JavaScript console, I get the following: analysis.slides.html:1992 Uncaught ReferenceError: Reveal is not defined analysis.slides.html:2032 Uncaught ReferenceError: Reveal is not defined require.min.js:8 Uncaught Error: Mismatched anonymous define()

Python multiprocessing pool stuck

不羁岁月 提交于 2019-12-05 13:12:11
I'm trying to run some sample code of the multiprocessing.pool module of python, found in the web. The code is: def square(x): return x * x if __name__ == '__main__': pool = Pool(processes=4) inputs = [0, 1, 2, 3, 4] outputs = pool.map(square, inputs) But when i try to run it, it never finsh the execution and i have to restart the kernel of my IpythonNotebook notebook. What's the problem? KT. As you may read from the answer pointed out by John in the comments, multiprocessing.Pool , in general, should not be expected to work well within an interactive interpreter. To understand why it is the

Unicode in ipython notebook

这一生的挚爱 提交于 2019-12-05 13:10:53
I'm trying to get a "degree" sign (°) in a matplotlib plot from ipython notebook. When I run ax = plt.gca() ax.set_xlabel("something at 55" + unicode("\xc2", errors='replace')) ax.plot([0.,1.,], [0.,1.]) I get a plot, but instead of the degree sign, I have a strange black square with a question mark. This also happens when I try to savefig the figure to PDF. If I try to run ax = plt.gca() ax.set_xlabel("something at 55°") ax.plot([0.,1.,], [0.,1.]) I get an error (see below). Any idea what I'm doing wrong? --------------------------------------------------------------------------- ValueError

Running IPython Notebook viewer locally

只愿长相守 提交于 2019-12-05 11:38:09
Im trying to introduce IPython notebook in my work. One of the ways I want to do that is by sharing my own work as notebooks with my colleagues so they would be able to see how easy it is to create sophisticated reports and share them. I obviously can't use Notebook viewer since most of our work is confidential. I'm trying to set up notebook viewer locally. I read this question and followed the instructions there, but now that nbconvert is part of IPython the instructions are no longer valid. Can anybody help with that? You have a couple of options: As described above convert to HTML and then

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

安稳与你 提交于 2019-12-05 11:08:24
问题 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

How to align widget buttons in IPython notebook

☆樱花仙子☆ 提交于 2019-12-05 10:43:56
I have the following peace of code from ipywidgets import widgets from IPython.display import display import numpy as np class Test(object): def __init__(self, arraylen): self.a = np.random.randn(arraylen) self.button = widgets.Button(description = 'Show') self.button.on_click(self.show) display(self.button) self.button1 = widgets.Button(description = 'Show1') self.button1.on_click(self.show) display(self.button1) def show(self, ev = None): np.savetxt('test',self.a) self.button.disabled = True test = Test(10) The output is two buttons in a column as shown here: Would it also be possible, to

ERROR: Line magic function `%matplotlib` not found

只愿长相守 提交于 2019-12-05 09:53:35
问题 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