ipython-notebook

Can IHaskell and IPython coexist?

↘锁芯ラ 提交于 2020-01-04 14:01:17
问题 I have IPython and IPython Notbook installed and am working my way through the IHaskell installation instructions. I have all the IHaskell prerequisites installed, but before I commit to the final step of installing IHaskell itself with cabal install ihaskell --reorder-goals I want to confirm one — perhaps obvious — thing: Will I still be able to use Python Notebooks? The instructions following the step above seem to say that simply entering ipython notebook will run Haskell rather than

Widgets not showing in NBViewer

别说谁变了你拦得住时间么 提交于 2020-01-04 05:19:09
问题 I have an iPython Notebook with an interactive slider widget: To share the notebook, I would like to use the link provided by NBViewer. This would allow me to share the notebook with people that don't use Python. Unfortunately, the widget does not show when viewing the NBViewer link: Is there something I need to do to make widgets work with NBViewer? 回答1: Widgets are not shown in nbviewer with current ipython 2.x. IPython 3 is supposed to add persistent widgets that can be shown by nbviewer.

Center align outputs in ipython notebook

旧巷老猫 提交于 2020-01-04 02:15:07
问题 I want to center align the outputs (which includes text and plots) in my ipython notebook . Is there a way in which I can add styling in the same notebook for the same? Code or screenshot examples would greatly help. 回答1: Try running this in a code-cell to override the default CSS for an output cell: from IPython.display import display, HTML CSS = """ .output { align-items: center; } """ HTML('<style>{}</style>'.format(CSS)) Example You can see here that the right side of the table is cut-off

How to make nbviewer display local files?

大城市里の小女人 提交于 2020-01-03 18:34:08
问题 I've got nbviewer installed and working. I see it has a --localfiles option that takes a folder name. It says: "Serving local notebooks in /home/gb/S14/inclass, this can be a security risk" But I can't figure out the URL format to get it to look for the file there. The code adds a handler for /localfile/(.*) but that doesn't seem to get triggered. Anyone know how to format name to give to trigger loading a local file? 回答1: One minute later and it occurs to me that the front page might not

Run IPython Notebook in Iframe from another Domain

强颜欢笑 提交于 2020-01-03 15:16:09
问题 I want to run an IPython notebook that is on my server inside an iframe on another server. I get this error: Refused to display 'my_url/Test.ipynb' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN' Here it says I should set some x-frame-header option for this: http://ipython.org/ipython-doc/dev/whatsnew/development.html#iframe-embedding Where can I set this? How to change this X-Frame-Option so that it can be embedded from another site? :) 回答1: Update according to the comment by

Changing the font in iPython notebook markdown cells

故事扮演 提交于 2020-01-02 10:01:39
问题 I just wanted to change the default font in Ipython (1.0.0) notebook markdown cells to something else, and tried doing this using style tags in a markdown cell instead of going through the path of creating a custom.css. I do not know CSS, and my needs are very minimal. After some research, I found the following code snippet: <style> div.text_cell_render { font-family: "Times New Roman", serif; ... } </style> I applied the above CSS code to a markdown cell, however the font in the other

How to merge two ipython notebooks correctly without getting json error?

微笑、不失礼 提交于 2020-01-02 07:15:10
问题 I have tried: cat file1.ipynb file2.ipynb > filecomplete.ipynb since the notebooks are simply json files, but this gives me the error Unreadable Notebook: Notebook does not appear to be JSON: '{\n "metadata": {' I think these must be valid json files because file1 and file2 each load individually into nbviewer, and so I am not entirely sure what I am doing wrong. 回答1: This Python script concatenates all the notebooks named with a given prefix and present at the first level of a given folder .

Centering output on IPython notebook

♀尐吖头ヾ 提交于 2020-01-02 06:46:26
问题 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. 回答1: 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;

IPython notebook ~ Using javascript to run python code?

此生再无相见时 提交于 2020-01-02 06:08:54
问题 I am trying to execute python code through javascript directly: I fire up IPython Notebook on Chrome Using chrome developer tools I open up the javascript console. In the javascript consolde, I type: IPython.notebook.kernel.execute("2+2") But I get a strange output: "6CEA73CC644648DDA978FDD6A913E519" Is there any way to take advantage of all the IPython javascript functions available, to run python code from the javascript console as depicted in the image? I'm sure there's a way but I've been

500 server error using IPython notebook on Windows

两盒软妹~` 提交于 2020-01-02 05:47:08
问题 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