ipython-notebook

Plotly import error for exceptions module

微笑、不失礼 提交于 2019-12-04 10:10:23
I have searched all over and couldn't find the solution to this problem. I am trying to import plotly in Jupyter Notebook with following code and getting the following error respectively Code: import sys print(sys.path) sys.path.append('/usr/local/lib/python2.7/dist-packages') import plotly Error: --------------------------------------------------------------------------- ImportError Traceback (most recent call last) <ipython-input-3-b41540b5e198> in <module>() 3 sys.path.append('/usr/local/lib/python2.7/dist-packages') 4 ----> 5 import plotly /usr/local/lib/python2.7/dist-packages/plotly/_

How to post ipython notebook thread into Wordpress blog?

微笑、不失礼 提交于 2019-12-04 08:33:36
I know nbconvert and I am able to convert notebook file into html but I cannot find a way to embed this html file into wordpress. Is there anyone who tried and succeed? We can solve this issue using Simple Mathjax Plugi n. For that please follow the below steps: Install and Activate the plugin. Disable WordPress HTML code parsing(this is for displaying the images in the HTML output). Copy and paste the HTML output of nbconvert (content inside the <body> tag) in the Text tab. 来源: https://stackoverflow.com/questions/20609114/how-to-post-ipython-notebook-thread-into-wordpress-blog

IPython Notebook: What is the default encoding?

♀尐吖头ヾ 提交于 2019-12-04 08:11:15
问题 I have created a package using the encoding utf-8. When calling a function, it returns a DataFrame , with a column coded in utf-8. When using IPython at the command line, I don't have any problems showing the content of this table. When using the Notebook, it crashes with the error 'utf8' codec can't decode byte 0xe7 . I've attached a full traceback below. What is the proper encoding to work with Notebook? UnicodeDecodeError Traceback (most recent call last) <ipython-input-13-92c0011919e7> in

How can I open an IPython notebook without the output?

会有一股神秘感。 提交于 2019-12-04 08:05:40
问题 I have an IPython notebook where I've accidentally dumped a huge output (15 MB) that crashed the notebook. Now when I open the notebook and attempt to delete the troublesome cell, the notebook crashes again—thus preventing me from fixing the problem and restoring the notebook to stability. The best fix I can think of is manually pasting the input cells to a new notebook, but is there a way to just open the notebook without any outputs? 回答1: There is this nice snippet (that I use as a git

View pdf image in an iPython Notebook

隐身守侯 提交于 2019-12-04 07:41:03
问题 The following code allows me to view a png image in an iPython notebook. Is there a way to view pdf image? I don't need to use IPython.display necessarily. I am looking for a way to print a pdf image in a file to the iPython notebook output cell. ## This is for an `png` image from IPython.display import Image fig = Image(filename=('./temp/my_plot.png')) fig Thank you. 回答1: The problem you (and others) face is that PDFs cannot be displayed directly in the browser. The only possible way to get

Inline math mode on iPython notebook

丶灬走出姿态 提交于 2019-12-04 07:12:02
In iPython notebook, how can I write a mathematic formula such as r^2 in a line (inline math mode in latex vocabulary). ie. Is it possible to not go on a new line when the formula is printed. If like in LaTeX, it should be \(r^2\) but it doesn't work... Thanks for your help ! In a markdown cell you can use $s, e.g. $r^2$. This requires MathJax from CDN or a local MathJax installation. If you have an internet connection it should work right out of the box. see e.g. Typesetting Equations example notebook 来源: https://stackoverflow.com/questions/19412644/inline-math-mode-on-ipython-notebook

IPython: How to show the same plot in different cells?

你。 提交于 2019-12-04 06:48:02
I'm still new to IPython Notebooks, Jupyter, and Python in general. I'm creating a scatter plot in a Jupyter notebook using the following code: import numpy as np import matplotlib.pyplot as plt n = 1024 X = np.random.normal(0, 1, n) Y = np.random.normal(0, 1, n) plt.axes([0.025, 0.025, 0.95, 0.95]) plt.scatter(X, Y, s=50) plt.show() My question is, how can I get a reference to the plot object so I can use it in a different cell later on in the notebook? Additionally, I may need to modify the plot before showing it again. Also, I have %matplotlib inline at the top of my notebook. Here are some

Module Successfully Installed, but Not Found in IPython

佐手、 提交于 2019-12-04 06:24:07
问题 I have installed the package bigfloat and the MPFR and GMP libraries. When I run python in the terminal (I use a Mac), bigfloat can be imported and works successfully. However, I typically write my scripts in iPython Notebook. When I try to import bigfloat here, it says 'module not found.' I have installed other packages such as SciPy, and using print scipy. file I see that it is located at //anaconda/lib/python2.7/site-packages/scipy/ init .pyc I'm not sure of how to check where bigfloat is

Kernel Error in R Notebook using Jupyter Notebook

随声附和 提交于 2019-12-04 05:18:32
I am trying to use R within the jupyter notebook. I went to my R shell and ran install.packages(c('rzmq','repr','IRkernel','IRdisplay'), repos = c('http://irkernel.github.io/', getOption('repos'))) IRkernel::installspec() Then I loaded up my ipython notebook and created a new notebook using the now available R extension. How ever when I access the notebook I run into this kernal error: Traceback (most recent call last): File "C:\Users\Nina Kate\Anaconda3\lib\site-packages\IPython\html\base\handlers.py", line 394, in wrapper result = yield gen.maybe_future(method(self, *args, **kwargs)) File "C

How do I separate slides when exporting an IPython notebook to reveal.js?

吃可爱长大的小学妹 提交于 2019-12-04 04:23:57
When I execute an IPython notebook to a reveal.js presentation using ipython nbconvert mynotebook.ipynb --to slides --post serve I am getting all the content as a single slide. How do I separate my content into several slides? I tried using --- (hinted in this video), \n\n\n and === inside the notebook (as separate cells and before my titles), but it didn't change anything. I know that for a Markdown input file in reveal.js one can set the data-separator option, but the generated html file doesn't seem to include the content as Markdown, but inlines everything using HTML tags, so I don't know