ipython-notebook

Support of html tags and right-to-left languages in Jupyter

走远了吗. 提交于 2019-12-05 01:51:18
问题 In ipython notebooks we could add html tags inside markdowns. A useful tag for right-to-left languages was <p dir=rtl> text </p> that conveniently made the text aligned to right. Is there a way to add html tags or right-to-left paragraph alignment in Jupyter? 回答1: It can be done like this: <div style="direction:rtl"> Right-to-left text </div> 来源: https://stackoverflow.com/questions/35238470/support-of-html-tags-and-right-to-left-languages-in-jupyter

Cannot import modules in jupyter notebook; wrong sys.path

落花浮王杯 提交于 2019-12-05 00:28:34
I am having a problem importing modules in my iPython/Jupyter notebook. The problem fundamentally lies in where the sys.path is pointing to. From the iPython/Jupyter notebook, sys.executable returns: '/usr/bin/python' However, from the command line, it returns: '//anaconda/bin/python' I have tried un-installing and re-installing anacondas, but the problem still remains. I have also tried augmenting $PYTHONPATH in my bash_profile to include //anaconda/bin/python, but this doesn't resolve it. Is there anyway to change the sys.path in my jupyter notebook permanently, without simply using sys.path

figure caption centering in nbconvert?

这一生的挚爱 提交于 2019-12-04 19:43:54
I have cells underneath figures in an ipython notebook that contain figure caption text. I would like them to be centre('center')-aligned. I use "< center >" in the markdown, which gives exactly the appearance I'm after in the notebook. But when nb-converting to latex, the text gets shunted over to the left. So is there a way to get nbconvert to recognize text alignment in markdown cells when converting to latex? Thanks. You have actually asked two different questions: is there a way to get nbconvert to recognize text alignment in markdown cells figure caption (centering) in nbconvert ad 1) To

module not found on ipython notebook

梦想与她 提交于 2019-12-04 16:48:44
问题 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

How to cache in IPython Notebook?

允我心安 提交于 2019-12-04 16:23:57
问题 Environment: Python 3 IPython 3.2 Every time I shut down a IPython notebook and re-open it, I have to re-run all the cells. But some cells involve intensive computation. By contrast, knitr in R save the results in a cache directory by default so only new code and new settings would invoke computation. I looked at ipycache but it seems to cache a cell instead of the notebook. Is there a counterpart of cache of knitr in IPython? 回答1: Can you give an example of what you are trying to do? When I

Control LaTeX expression color in ipython qtconsole

给你一囗甜甜゛ 提交于 2019-12-04 13:47:39
问题 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? 回答1: 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

iPython notebook Websocket connection cannot be established

五迷三道 提交于 2019-12-04 12:09:59
问题 iPython was working fine until a few hours ago when I had to do a hard shutdown because I was not able to interrupt my kernel. Now opening any notebook gives me the following error: "WebSocket connection to could not be established. You will NOT be able to run code. Check your network connection or notebook server configuration." I have the latest version of Chrome and I am only trying to access local notebooks. The Javascript console gives me this: Starting WebSockets: [link not allowed by

ipython notebook terminals unavailable [duplicate]

耗尽温柔 提交于 2019-12-04 12:02:12
问题 This question already has answers here : what is the ipython notebook “Terminals” menu option (4 answers) Closed 3 years ago . I installed anaconda and I get this (python 2.7.9) I am running ipython notebook on Windows 8 and terminal option unavailable for me. How do I activate it? please 回答1: Windows do not support tty terminal, and terminado only works if the underlying terminal is a tty. So for now there is not support for terminals on Windows. There is no short-term plan to support

How to keep the current figure when using ipython notebook with %matplotlib inline?

时间秒杀一切 提交于 2019-12-04 11:54:17
I could not find answer for this, so please let me ask here. I would like to keep the current figure in ipython notebook when using %matplotlib inline . Is that possible? For example, I want to plot 2 lines in a graph plt.plot([1,2,3,6],[4,2,3,4]) plt.plot([3.3, 4.4, 4.5, 6.5], [3., 5., 6., 7.]) If I put those two command lines in a cell it is ok. The graph shows two lines. However, if I put them separately into two cells, when the second cell (plt.plot([3.3, 4.4, 4.5, 6.5], [3., 5., 6., 7.])) is executed, the previous plot(plt.plot([1,2,3,6],[4,2,3,4])) is cleared. I want to plot a graph with

How to make a histogram in ipython notebook using ggplot2 (for python)

时光怂恿深爱的人放手 提交于 2019-12-04 11:00:17
问题 I'm trying to make a histogram of a simple list of numbers in python using ipython notebook and ggplot for python. Using pylab, it's easy enough, but I cannot get ggplot to work. I'm using this code (based on the diamond histogram example, which does work for me): from ggplot import * a = [1, 1, 2, 1, 1, 4, 5, 6] p = ggplot(aes(x='carat'), data=a) p + geom_hist() + ggtitle("Histogram of Diamond Carats") + labs("Carats", "Freq") Using ipython & pylab, I can make a histogram with just hist(a)