ipython-notebook

Typesetting Math using MathJax for IPython Notebook Web page

青春壹個敷衍的年華 提交于 2019-12-25 01:36:48
问题 I chose to learn to write mathematical expressions in IPython Notebook and sat to explore learning resources. I found this official link. I reproduced the whole tutorial on my IPython NoteBook locally and then published it on my website. I also explained the whole struggle I went into while trying to achieve this in my blog post. Unfortunately, whatever I do, I am not able to get the web page render/display the math expressions at all . I am not sure why the whole notebook failed to show the

Executing Python Code in IPython Kernel

偶尔善良 提交于 2019-12-24 23:44:35
问题 I want to duplicate ipython notebook capability in Emacs / Pymacs; and I need some direction for a simple code that can 1) send python / "magics" code to a ipython kernel 2) receive the display output, as a string. I found this comment by minrk, the "ipython kernel" example did not work, it gave "ImportError: No module named zmq.blockingkernelmanager". I had better luck with one his other pointers, finally I landed at ipython-1.1.0/IPython/kernel/inprocess/tests/test_kernel.py, I ripped out a

Aesthetics of barplot bars and error bars in seaborn

喜欢而已 提交于 2019-12-24 14:40:32
问题 I'm using the seaborn library to visualize data and I want to change some things about the output graphs for publication. I want the error bars to be more narrow, with caps, and I'd like the border around all of the bars to be black. I imagine that there is some way to change the plot using pyplot (or perhaps the rc dictionary in sns.set_context), but I can't figure out how to do this. colors = ["black", "grey", "white"] g = sns.barplot("TYPEMOD", "SCORE", ci=68, data=final_data, palette=sns

IPython notebook: How to write cell magic which can access notebook variables?

天涯浪子 提交于 2019-12-24 14:15:07
问题 My question is: How can I write an IPython cell magic which has access to the namespace of the IPython notebook? IPython allows writing user-defined cell magics. My plan is creating a plotting function which can plot one or multiple arbitrary Python expressions (expressions based on Pandas Series objects), whereby each line in the cell string is a separate graph in the chart. This is the code of the cell magic: def p(line, cell): import pandas as pd import matplotlib.pyplot as plt df = pd

converting functions of %matplotlib notebook into Python script

核能气质少年 提交于 2019-12-24 07:35:39
问题 I'm trying to convert several python notebook file into python scripts so that I can create a python package... The problem I'm having now is that in python notebook, there's %matplotlib notebook magic button that makes user can click on a plot and receive the coordinate of the plot he/she just clicked on. The way to realize it is below: f = urllib.urlopen(url_link) fig = plt.figure(figsize=(3,3)) coords = coordinates(my_coord)[1] image = plt.imread(f) plt.imshow(image) collector = {'x':0,'y'

Jupyter / Ipython Notebook Html Page View

一个人想着一个人 提交于 2019-12-24 07:19:12
问题 I installed Ipython Notebook but html page does not seem correct. Tabs and links do not seem correctly installled. You may see the screenshot samples as attached. Can anyone advise how I can fix this ? 回答1: I am sure, it is just internet connection trouble, not IPython (Jupyter) Notebook. But chech up information about Browser Compatibility. Browser Compatibility. The IPython notebook is officially supported on the following browsers: Chrome ≥ 13, Safari ≥ 5, Firefox ≥ 6. The is mainly due to

Jump to next code cell (IPython notebook)

三世轮回 提交于 2019-12-24 05:22:10
问题 I use the IPython 2.0 Notebook for teaching. The notebooks are created before the teaching session, and used as-is during the session. Sure, when I prepare the notebook, it has sense that I access all the cells in sequence (actually, I don't). Back in class, while I present the concepts and the code to the students, I don't need the focus to be put on the next cell, I just need the cursor to wait in the next code cell... The best I can hope is that someone has been able to change the default

iPython Notebook not printing Dataframe as table

守給你的承諾、 提交于 2019-12-24 04:59:27
问题 I'm trying to print a df in ipython notebook but it doesn't print it as a table. data = {'year': [2010, 2011, 2012, 2011, 2012, 2010, 2011, 2012], 'team': ['Bears', 'Bears', 'Bears', 'Packers', 'Packers', 'Lions', 'Lions', 'Lions'], 'wins': [11, 8, 10, 15, 11, 6, 10, 4], 'losses': [5, 8, 6, 1, 5, 10, 6, 12]} football = pd.DataFrame(data, columns=['year', 'team', 'wins', 'losses']) print football Output year team wins losses 0 2010 Bears 11 5 1 2011 Bears 8 8 2 2012 Bears 10 6 3 2011 Packers

Ipython notebook - fails to open

妖精的绣舞 提交于 2019-12-24 04:38:07
问题 I have tried to open ipython notebook without luck and don't know why? When i type the command "ipython notebook", the output i receive is : -bash: /usr/local/bin/ipython: /usr/local/opt/python/bin/python2.7: bad interpreter: No such file or directory Any help ? 回答1: This issue can be caused by: multiple python installs, virtualenvs, and/or broken python path variable. If you are using homebrew on mac or anaconda distribution, it can also cause version conflicts with pip and subsequent

Why does savefig and plot commands have to be in the same cell in an IPython notebook?

和自甴很熟 提交于 2019-12-24 00:53:05
问题 I was trying to export some plots from a IPython notebook. Searching I've found this question and could sort the issue. As it's noted in the answer, I had to call savefig in the same cell as the plot commands. My question is, why do those calls must be in the same cell? My notebook server was started in --pylab=inline mode. If it's not inline the plot are exported just fine. 回答1: I think you are seeing the behavior from this part of IPython 's code base: def show(close=None): """Show all