ipython-notebook

read-only cells in ipython notebook

别来无恙 提交于 2019-12-03 12:16:10
Is there a way to mark a cell in the ipython notebook readonly using the json format in the ipynb file? (E.g., a cell attribute "readonly":false or some such.) If not, is there a jquery hack to find suppress the double click event in the cell? Yes, Use the steps below Select view on the menubar Point to Cell Toolbar and select Edit Metadata An "Edit Metadata" button will appear at the top-right corner of the cell. Click on that button and edit the json that pops up. Set the editable key to true of false to get the desired effect. There is an extension for IPython that is supposed to that: Read

Changing browser for IPython Notebook from system default

◇◆丶佛笑我妖孽 提交于 2019-12-03 11:25:36
问题 I would like to keep firefox as my system default browser on my Mac, but launch IPython Notebook in Chrome [1] . This answer led me to my ipython_notebook_config.py file but I can't get an instance of Chrome running. After c = get_config() and import webbrowser , I've tried: webbrowser.register(u'chrome', None, webbrowser.Chrome()) webbrowser.register(u'chrome', webbrowser.Chrome) webbrowser.register(u'chrome', None, webbrowser.GenericBrowser('/Applications/Browsers/Chrome.app')) webbrowser

Ipython Notebook: where is jupyter_notebook_config.py in Mac?

为君一笑 提交于 2019-12-03 11:23:20
问题 I just started using a Mac, so please forgive me if this sounds too naive. I'm trying to install Interactive Parallel . From https://github.com/ipython/ipyparallel, it says I need to find jupyter_notebook_config.py . I've already installed python and related packages with Anaconda , and I can use the ipython notebook. But when I search with spotlight for jupyter_notebook_config.py , I just can't find this file: So, where can I find this file? UPDATE: this is my home folder: There is only

Matplotlib animation not working in IPython Notebook (blank plot)

北战南征 提交于 2019-12-03 11:17:45
I've tried multiple animation sample codes and cannot get any of them working. Here's a basic one I've tried from the Matplotlib documentation: """ A simple example of an animated plot """ import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation fig, ax = plt.subplots() x = np.arange(0, 2*np.pi, 0.01) # x-array line, = ax.plot(x, np.sin(x)) def animate(i): line.set_ydata(np.sin(x+i/10.0)) # update the data return line, #Init only required for blitting to give a clean slate. def init(): line.set_ydata(np.ma.array(x, mask=True)) return line, ani = animation

module not found on ipython notebook

六眼飞鱼酱① 提交于 2019-12-03 10:39:21
I have an ipython notebook which starts with import sklearn When I run it, I get : ImportError: No module named sklearn indeed if I run the following snippet on the notebook, it's not showing scikit_learn: import pip installed_packages = pip.get_installed_distributions() installed_packages_list = sorted(["%s==%s" % (i.key, i.version) for i in installed_packages]) print installed_packages_list However when I run the snippet from command line, scikit_learn is in the list. I thought of a version problem (module installed for one version and not on the other one), bur both on notebook and command

Centering Text in IPython notebook markdown/heading cells?

戏子无情 提交于 2019-12-03 09:24:10
I want to customize my notebook, make it more readable and stylish. So for that, I want to start with centering my headers. Is it possible? You can actually use the markdown mode for the cell and use the normal HTML code, as in <h1><center>Centered text!</center></h1> Not directly with markdown i think, but you can just enter HTML in the markdown cells: <h3 align="center">This is a centered header</h3> Knowing that in jupyter (ipython) notebook markdown cells the title level is identified by the number of # ( # for top level headings or h1, ## for h2, ....), I use the following combination of

IPython Notebook Sympy Math Rendering

感情迁移 提交于 2019-12-03 09:00:36
问题 I have just started with using IPython Notebook and have been fascinated by its power. I have been using a few examples available on the net to get started with. I was following this tutorial: http://nbviewer.ipython.org/url/finiterank.com/cuadernos/suavesylocas.ipynb but the maths output is not getting rendered as expected. Below is the my code and the output: In [30]: %load_ext sympyprinting %pylab inline from __future__ import division import sympy as sym from sympy import * init_printing(

IPython: How to wipe IPython's history selectively & securely?

≡放荡痞女 提交于 2019-12-03 08:20:16
问题 I have been learning how to use the paramiko package only to discover that all I stored passwords in plain text in IPython's %hist . Not so good. I therefore need to get rid of particular parts of what is stored in %hist . Saying that, I do not want to wipe the whole history . - Only the parts where I have been careless enough to type password = or similar chosen terms. Thanks Comments I don't need: %clear only clears the session. It does not wipe the history. Yes. I will only use xSA_keys

Is it possible to create grouping of input cells in IPython Notebook?

强颜欢笑 提交于 2019-12-03 08:19:53
问题 When I do data analysis on IPython Notebook, I often feel the need to move up or down several adjacent input cells, for better flow of the analysis story. I'd expected that once I'd create a heading, all cells under that heading would move together if I move the heading. But this is not the case. Any way I can do this? Edit: To clarify, I can of course move cells individually, and the keyboard shortcuts are handy; but what I'm looking for is a way to group cells so that I can move (or even

Control LaTeX expression color in ipython qtconsole

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-03 08:18:49
I'm using a dark background for ipython. I would like to have sympy expressions pretty-printed with LaTeX. Problem is the current LaTeX font is black. How can I change LaTeX font colors in the ipython terminal? asmeurer You can set the forecolor and backcolor options in sympy.init_printing . For example, to print the equations in blue, use In [1]: init_printing(forecolor="Blue") 来源: https://stackoverflow.com/questions/18257270/control-latex-expression-color-in-ipython-qtconsole