ipython-notebook

Running IPython Notebook viewer locally

南楼画角 提交于 2020-01-02 04:55:26
问题 Im trying to introduce IPython notebook in my work. One of the ways I want to do that is by sharing my own work as notebooks with my colleagues so they would be able to see how easy it is to create sophisticated reports and share them. I obviously can't use Notebook viewer since most of our work is confidential. I'm trying to set up notebook viewer locally. I read this question and followed the instructions there, but now that nbconvert is part of IPython the instructions are no longer valid.

pyspark in Ipython notebook raises Py4JNetworkError

断了今生、忘了曾经 提交于 2020-01-02 04:54:06
问题 I was using IPython notebook to run PySpark with just adding the following to the notebook: import os os.chdir('../data_files') import sys import pandas as pd %pylab inline from IPython.display import Image os.environ['SPARK_HOME']="spark-1.3.1-bin-hadoop2.6" sys.path.append( os.path.join(os.environ['SPARK_HOME'], 'python') ) sys.path.append( os.path.join(os.environ['SPARK_HOME'], 'bin') ) sys.path.append( os.path.join(os.environ['SPARK_HOME'], 'python/lib/py4j-0.8.2.1-src.zip') ) from

How to add automatically extension to Jupyter (ipython) notebook?

我们两清 提交于 2020-01-02 04:53:08
问题 I have installed extension 'calico-document-tools' and I can load it from within Jupyter notebook using: %%javascript IPython.load_extensions('calico-document-tools'); How can I load it automatically for each opened notebook? I tried adding IPython.load_extensions('calico-document-tools'); or IPython.load_extensions('C:/Users/<username>/.ipython/nbextensions/calico-document-tools'); to C:\Users\<username>\.ipython\profile_default\static\custom\custom.js but it didn't work (extension should

How to recover a notebook emptied after kernel crash?

£可爱£侵袭症+ 提交于 2020-01-02 01:20:36
问题 While working in an ipython notebook, eventually I had to Ctrl+C as the kernel seemed to be halted. The console gave me a message like: [NotebookApp] Kernel shutdown: 5faa86bf-........f6 [NotebookApp] Kernel shutdown: 71........22 [NotebookApp] .... (I had three notebooks running) But something went wrong and my notebook file.ipynb is empty (actually only the one I was actively using). Is there a way to recover that file before it was deleted? Some place where automatically-saved o manually

How do i setup Pyspark in Python 3 with spark-env.sh.template

这一生的挚爱 提交于 2020-01-01 07:13:11
问题 Because i have this issue in my ipython3 notebook, i guess i have to change "spark-env.sh.template" somehow. Exception: Python in worker has different version 2.7 than that in driver 3.4, PySpark cannot run with different minor versions 回答1: Spark does not yet work with Python 3.If you wish to use the Python API you will also need a Python interpreter (version 2.6 or newer). I had the same issue when running IPYTHON=1 ./pyspark . Ok quick fix Edit vim pyspark and change PYSPARK_DRIVER_PYTHON=

IPython3 automatically config %matplotlib inline

大城市里の小女人 提交于 2020-01-01 06:42:06
问题 I'm using IPython 3 / Jupyter, and I want to use the %matplotlib option by default. In IPython 2, I had the next option on the ~/.ipython/profile_default/ipython_notebook_config.py c.InteractiveShellApp.matplotlib = 'inline' But in IPython 3, this option is not available anymore. It also disappeared the setting c.InlineBackend.rc, which I used to set up the appearance of charts. How those options can be set now? 回答1: Use the option in ~/.ipython/profile_default/ipython_kernel_config.py 回答2:

How to enable line wrapping in ipython notebook

纵然是瞬间 提交于 2019-12-31 19:29:06
问题 I have been trying to enable line wrapping in ipython notebook. I googled it with no results and i typed ipython notebook --help in a terminal. This gives me a ton of configuration commands for a config file, but no line wrapping. Does anyone know if ipnotebook has this feature and if so how to enable it? Your help would be greatly appreciated. Thank you. 回答1: As @Matt pointed out you have to configure CodeMirror to enable wrapping. However, this can be achieved by simply adding the following

Weird behaviour with semicolon before function call in ipython/ipython notebook

六月ゝ 毕业季﹏ 提交于 2019-12-30 20:34:30
问题 I stumbled upon some strange behaviour using ipython-notebook and wondered what, if any, the purpose was. If you enter a semicolon before a function call, you get the result of applying the function to a string which reflects all the code after the function name. For example, if I do ;list('ab') I get the result of list("('ab')") : In [138]: ;list('ab') Out[138]: ['(', "'", 'a', 'b', "'", ')'] I'm using jupyter with ipython 4 . It happens in ipython as well as ipython notebook . Has anyone

Ipython Notebook: how to run multiple cells?

淺唱寂寞╮ 提交于 2019-12-30 08:18:31
问题 My notebook gets a bit of long, I divide it into several parts. Sometimes, I just want to run a certain part of it, i.e consecutive cells For example, I want to run Cell IN [52] to[54] , not run IN [51],[59] . How can I do it? I only know there is option for run above , run below , I didn't see anything like run selected cells . UPDATE: Now Jupyter Notebook has this feature built-it, simply CTRL + click 回答1: UPDATE as per Jan 2018: You can select and run multiple cells in command mode using

Synchronizing code between jupyter/iPython notebook script and class methods

大憨熊 提交于 2019-12-30 07:06:07
问题 I'm trying to figure out the best way to keep code in an Jupyter/iPython notebook and the same code inside of a class method in sync. Here's the use case: I wrote a long script that uses pandas inside a notebook, and have multiple cells which made the development easy, because I could check intermediate results within the notebook. This is very useful with pandas scripts. I downloaded that working code into a Python ".py" file, and converted that script to be a method within a Python class in