ipython-notebook

How to pass the class path to ipython's notebook when called from ipzope?

瘦欲@ 提交于 2019-12-11 21:40:00
问题 I've been using iypthon as set from ipzope (buildout) for a while and it works without problems. Now I'm trying to use ipython's notebook and I cannot set it up properly. When I create a new notebook it stops IPython's Kernel with an ImportError (see below). I guess that the created Thread in IPython.html.notebook.start() opens the webbrowser without passing the sys.path from the calling process. My workaround is to add the paths in ipzope to PYTHONPATH . When I add all the paths then ipython

ipython notebook not launching

若如初见. 提交于 2019-12-11 19:27:55
问题 I cannot get ipython notebook to launch. I used the command "ipython notebook" in command prompt but I got an error saying that "ipython" is not recognized as a command. I have Python 3.3 and ipython 1.2.1. This command works on my other Windows machine and I used the same process to install ipython. The only difference is that I am using Python 2.7 on my other Windows machine. I feel like there is a really simple fix or I have made a silly error. Any ideas? Edit: I tried ThomasK's suggestion

change IPython Notebook JSON file encoding

ⅰ亾dé卋堺 提交于 2019-12-11 16:45:04
问题 By default, the JSON notebooks' encoding is ASCII: { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "2.1.4. Nombre d'\u00e9l\u00e9ments: call/function/len" ] }, Is it possible to change that into UTF-8? { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "2.1.4. Nombre d'éléments: call/function/len" ] }, I thought the option would be here, but I cannot figure out which one would make the trick. 回答1: No it's not possible. You are mistaking the file encoding and

How to display two local images side by side in jupyter?

梦想的初衷 提交于 2019-12-11 12:18:24
问题 I want to display two images, that I have them saved locally , in one single makedown cell side-by-side ? I found previous post but it uses HTML() not Image() method. The way I tried was: from IPython.core.display import Image, display display(Image('/whateverfile/counts1.png',width=100,height=100), Image('/whateverfile/counts2',width=100, height=100)) But that did not work. Any ideas how to solve this? Thanks 回答1: from IPython.display import HTML, display display(HTML("<table><tr><td><img

Automatically update image in IPython notebook

二次信任 提交于 2019-12-11 12:03:04
问题 I have a number of png images that get updated somewhat regularly and want to include them in an IPython notebook, having them automatically updated in the notebook. I thought I could do it by adapting the following matplotlib example: import numpy as np import matplotlib.pyplot as plt from IPython import display import time %matplotlib inline plt.ion() fig = plt.figure() ax = fig.gca() fig.show() for i in range(10): mu, sigma = 200, 25 x = mu + sigma*np.random.normal(loc=2, scale=1, size=50)

OptionParser in ipython notebook?

核能气质少年 提交于 2019-12-11 11:46:20
问题 I am enjoying developing inside the ipython notebook, but I am having a problem when I want to write a main() function that reads the command line args (with OptionParser, for example). I want to be able to export the code to a .py file and run it from the command line, but I haven't found a way to have a main() that runs both in the notebook with predefined arguments or from the command line with python and command line args. What is the secret? In case that is not clear, I would like to do

IPython - importing/populating namespace with custom magic

北战南征 提交于 2019-12-11 11:27:22
问题 The %pylab magic in IPython imports a bunch of functions into the user's workspace, which is very convenient. Looking at the code, it's not at all obvious how this is done. What I have so far is a magic function in my startup folder: from IPython.core.magic import register_line_magic @register_line_magic def import_my_functions(line): """ Import functions into namespace somehow.... e.g. import numpy as np """ It then should be possible: In[1]: %import_my_functions imported the following:

Connecting Log4j to ipython notebook stderr in a java/python project using py4j

走远了吗. 提交于 2019-12-11 08:25:21
问题 I have a project that uses java, scala and Apache Spark to do distributed computations on genomic data. Using py4j and mimicking the PySpark model, we expose a python API that calls into the JVM. Our goal has been to bring this model into jupyter notebooks, which has been pretty easy so far, with one lingering problem: logging. The problem We (and Spark) use log4j to write log messages to a log file and stderr. This stderr is the stderr for the java process, so if I run two commands from the

Way to extract pickles coming in and out of ipython / jupyter notebook

戏子无情 提交于 2019-12-11 07:33:10
问题 I'm trying to summarize a data analysis project which runs across many ipython / jupyter notebooks and each notebook is fairly long. One of the things that would help this process is if I knew at least what the overall "input" pickles going in and "output" pickles going out. What's the cleanest/quickest/most efficient way to do this? 回答1: I'm not sure if this is the best way to do it, but it's at least one way... def summerize_pickles(notebook_path): from IPython.nbformat import current as

nbconvert multiindex dataframes to latex

半世苍凉 提交于 2019-12-11 03:43:29
问题 I'm trying to export a multi-index Pandas DataFrame to latex using ipython's nbconvert but the multi-index rows come out all wrong. I'm using the following code at the beginning of the code to convert to latex properly (I found it somewhere on SO but can't remember where): from sympy import latex from IPython.display import HTML, Latex, display, Math pd.set_option('display.notebook_repr_html', True) def _repr_latex_(self): return "\\begin{center} %s \end{center}" % self.to_latex() pd