ipython-notebook

IPython Notebook %%bash Magic Error

我只是一个虾纸丫 提交于 2019-12-08 03:15:37
问题 I'm trying to follow a version control tutorial in an IPython Notebook by Fernando Perez, a static version of which can be found here. He uses the %%bash magic extensively, but When I use it I get the following error: ERROR: Cell magic function %%bash not found. Even though when I use the !git command; everything works fine. Specifics: C:\Python27\Scripts; C:\Program Files (x86)\Git\cmd; C:\Program Files (x86)\Git\bin\; Are all added to my system path. I'm running the 0.13.2 version of

How to display data in a matplot plot

落花浮王杯 提交于 2019-12-08 02:04:47
问题 I'm trying to make an interactive plot in the jupyter notebook but i don't know exactly how to implement it. Having a dataframe i run a simple regression that is then plotted to see the distribution. I'd like to be able to hover one of the points and get data associated with this point. How can i do that? Right now i can only produce a static plot import pandas as pd from sklearn import linear_model %matplotlib inline import matplotlib import matplotlib.pyplot as plt net = pd.read_csv(

IPython Notebook: Why do not appearing the widgets after installing correctly ipywidgets in DSX?

眉间皱痕 提交于 2019-12-08 01:50:46
问题 After installing ipywidgets in a Jupiter notebook, DSX (IBM Datascience Experience framework), it doesn't show the widget, just a static stuff or A Jupyter Widget Example: import ipywidgets as widgets widgets.Dropdown( options = { 'One': 1, 'Two': 2, 'Three': 3 }, value = 2, description = 'Number:', ) Result: A Jupiter Widget I have tried several versions of !jupyter nbextension enable --py widgetsnbextension --sys-prefix based on http://ipywidgets.readthedocs.io/en/latest/user_install.html,

iPython Notebook, Static Interact; What am I missing?

筅森魡賤 提交于 2019-12-07 18:23:34
问题 Recently I found this post on Interactive Widgets. I am trying to implement this in some simple code, which iterates the logistic equation, and plots the consequent timeseries: %matplotlib inline import numpy as np import matplotlib.pyplot as plt import pylab from IPython.html.widgets import interact plt.close('all') def logiter(r, x0, t): y = [] x = x0 for i in range(t): x = r*x*(1-x) y.append(x) fig, plt.plot(y) return fig Then import the relevant packages: from ipywidgets import

ipython notebook and ginput

℡╲_俬逩灬. 提交于 2019-12-07 17:12:13
问题 I am trying to create an interactive plot in ipython notebook. I am attempting to run the sample code from matplotlib's website as below. t = arange(10) plot(t, sin(t)) print("Please click") x = ginput(3) print("clicked",x) show() I get this error: /Library/Python/2.7/site-packages/matplotlib/backend_bases.pyc in start_event_loop(self, timeout) 2370 This is implemented only for backends with GUIs. 2371 """ -> 2372 raise NotImplementedError 2373 2374 def stop_event_loop(self):

Showing assignment results in IPython notebook?

折月煮酒 提交于 2019-12-07 16:47:25
I am writing a chain of equations/assignments from a heat transfer problem in ipython notebook (I am new to that one), like this: # nominal diameter d=3.55 # m # ambient temperature T0=15 # C # surface temperature Tw=300 # C # average film temperature Tm=(T0+Tw)/2+273.15 # K! # expansion coefficient, $$\beta=1/T$$ for ideal gas beta=1./Tm # temperature difference dT=Tw-T0 # C or K Is there a way to echo each assignment, so that those (mostly computed) values are shown? I am aware of the %whos magic, but that shows variables alphabetically. Ideally, I would like to get something like this: #

Different font settings for editing code and markdown cells in the Jupyter Notebook

点点圈 提交于 2019-12-07 15:59:00
问题 In the Jupyter notebook, I would like to use the regular Ubuntu font when editing markdown cells and UbuntuMono for code cells. I can change the fonts of both these cell types simultaneously by editing .jupyter/custom/custom.css like so: .CodeMirror pre { font-family: "Ubuntu Mono", monospace; font-size: 14pt; } I can also change the formatting of the headers in the markdown code cells: .cm-header { font-size: 110%; font-family: "Ubuntu"; } As well as how the text looks when rendered (after

IPython notebook in zc.buildout not using eggs path

泄露秘密 提交于 2019-12-07 13:45:28
I've build an environment with zc.buildout including IPython script. My problem is simple: if I launch IPython in console, everything is OK and I get all my eggs in sys.path but if I launch IPython notebook, I only get default system path. Is there any way to include all my eggs while starting notebook? Regards, Thierry So, I guess somewhere in the notebook startup a process is forked, which means sys.path will get reset and buildout's tricks won't help. I solved the problems as follows, although it's a bit dirty: Create an entry point as follows: setup(... entry_points = { 'console_scripts':

Jupyter notebook autocomplete showing duplicate options

北战南征 提交于 2019-12-07 12:51:58
问题 Jupyter notebook's autocomplete seems working, but somehow it will show duplicate options for the method. For example below: For each possible options, drop down menu will show 2 identical choices. Why this happen and how to fix it? 回答1: Relevant Github issue: https://github.com/ipython/ipython/pull/10969 This should be fixed in Ipython 6.3 release (track milestone completion here: https://github.com/ipython/ipython/milestone/48) 来源: https://stackoverflow.com/questions/48009983/jupyter

IPython notebook interactive function: how to save the updated function parameters

心已入冬 提交于 2019-12-07 12:20:46
问题 I wrote the code below in Ipython notebook to generate a sigmoid function controlled by parameters a which defines the position of the sigmoid center, and b which defines its width: %matplotlib inline import numpy as np import matplotlib.pyplot as plt def sigmoid(x,a,b): #sigmoid function with parameters a = center; b = width s= 1/(1+np.exp(-(x-a)/b)) return 100.0*(s-min(s))/(max(s)-min(s)) # normalize sigmoid to 0-100 x = np.linspace(0,10,256) sigm = sigmoid(x, a=5, b=1) fig = plt.figure