ipython-notebook

iPython notebook cannot render valid latex, is it possible to get an error message?

岁酱吖の 提交于 2019-12-11 03:33:07
问题 I have a strange problem. I am trying to render the following valid latex, $$\int_{x=0}^{x=h} u_t dx = \int_{x=0}^{x=h} (-au + du_x)_x dx + \int_{x=0}^{x=h} s(x,t,u) dx$$ in a markdown cell in an ipython notebook (version 0.13.2 built from source). If I instead render each term separately it works! $$\int_{x=0}^{x=h} u_t dx $$ $$\int_{x=0}^{x=h} (-au + du_x)_x dx$$ $$+ \int_{x=0}^{x=h} s(x,t,u) dx$$ Is it possible to get an error message to find out where the problem is? iPython is rendering

Marking Event Points on a Pandas plot

跟風遠走 提交于 2019-12-11 03:06:45
问题 I'm plotting some 2-D time series data, and I want to mark specific dates on the plot with an X or some other marker. For example, if I have all the data for each date running for the last 6 months, and I want to point out where Christmas was on this plot. What would be the easiest way to accomplish this? I can do it manually, but would prefer to add something that automates it in my code. Edit: My attempt at this so far. Not sure if there is anything the would work better. I had some trouble

Can Jupyter run a separate R notebook from within a Python notebook?

ぐ巨炮叔叔 提交于 2019-12-11 02:04:52
问题 I have a Jupyter notebook (python3) which is a batch job -- it runs three separate python3 notebooks using %run . I want to invoke a fourth Jupyter R-kernel notebook from my batch. Is there a way to execute an external R notebook from a Python notebook in Jupyter / iPython? Current setup: run_all.ipynb : (python3 kernel) %run '1_py3.ipynb' %run '2_py3.ipynb' %run '3_py3.ipynb' %run '4_R.ipynb' The three python3 notebooks run correctly. The R notebook runs correctly when opened separately in

Connect ipython-notebook via SSH tunnel from a remote location

↘锁芯ラ 提交于 2019-12-11 01:53:56
问题 I'm trying to open an ipython-notebook (which is running on a server) on a macbook from a remote location through an ssh tunnel but no data received. This is the command for the SSH tunnel ssh -L 5558:localhost:5558 -N -t -x user@remote-host and this is the command I used to lunch the notebook form the server ipython notebook --pylab=inline --port=5558 --ip=* --no-browser --notebook-dir notebooks Than I tried to open it on a new tab with this remote-host:5558 but no data received. Thanks in

pandas.to_datetime ERROR

蓝咒 提交于 2019-12-11 01:34:02
问题 I have a pandas dataframe and I want to convert the time column to datetime format. Time 30/May/2013 06:00:41 -0600 import pandas as pd df.index = pd.to_datetime(df.pop('Time')) But it always gives the following error.What is the problem with the code? :( AttributeError Traceback (most recent call last) <ipython-input-124-9219cf10d027> in <module>() ----> 1 df.index = pd.to_datetime(df.pop('Time')) AttributeError: 'module' object has no attribute 'to_datetime' 回答1: The to_datetime function

IPython notebook - unable to export to pdf

风流意气都作罢 提交于 2019-12-11 01:04:51
问题 I'm trying to export my IPython notebook to pdf, but somehow I can't figure out how to do that. I searched through stackoverflow and already read about nbconvert, but where do I type that command? In the notebook? In the cmd prompt? If someone can tell me, step by step, what to do? I'm using Python 3.3 and IPython 1.1.0. Thank you in advance :) 回答1: Convert the IPython notebook file to html. ipython nbconvert --to html notebook.ipynb This will convert the IPython document file notebook.ipynb

Ipython raw_input work around?

拥有回忆 提交于 2019-12-11 00:52:46
问题 I'm running a Python program that wants to accept raw_input which Ipython notebook does not do. (a known limitation) What is a recommended way to achieve the functionality? (work around?) What I'd like to do is to be able to run the program, accept input and respond..(will be choices determined based on information retrieved), and also prompting for user id and password info.. Of course I'd like to do as little violence to the existing code as possible. I found IPython.utils.io.raw_input_ext

Import from ipython

狂风中的少年 提交于 2019-12-11 00:47:36
问题 If I use IDLE with python 2.7 import cv import cv2 and it works but if I use ipython notebook it gives me error ImportError Traceback (most recent call last) in () ----> 1 import cv ImportError: No module named cv So how to use OpenCV from iPython? EDIT: from IDLE ['', 'C:\Python27\Lib\idlelib', 'C:\Python27\lib\site-packages\pip-1.1-py2.7.egg', 'C:\Python27\lib\site-packages\gensim-0.8.6-py2.7.egg', 'C:\WINDOWS\system32\python27.zip', 'C:\Python27\DLLs', 'C:\Python27\lib', 'C:\Python27\lib

How to define the default value of a Slider widget on ipywidgets?

谁说胖子不能爱 提交于 2019-12-11 00:34:57
问题 On a Jupyter Notebook and using ipywidgets I can create sliders using the compact version import ipywidgets as ip def f(x): print(x) ip.interact(f, x = (0, 1, 1)) The slider's default value is 0 but I would like to make it 1. How can I do this? 回答1: The widget abbreviations (using tuples to request sliders, etc.) only expose a small subset of the options that can be passed to a widget. Default values come from the default value in the function definition if available, or the center of the

How to autosave ipython notebook

别等时光非礼了梦想. 提交于 2019-12-10 17:27:48
问题 Does anyone know if there's an option (or a suggested hack) to make IPython notebooks save automatically before executing a cell? Many times I've been working on something without saving for quite some time, then I execute a stupid command that prints so much crap to the console that my browser becomes unresponsive, leading to me losing all my work. A timed autosave might also do the trick. 回答1: The development version has that feature fully implemented. Install it by following the